diff --git a/engine/api/event/event.go b/engine/api/event/event.go index ac1449c7a8..06ffa06d3c 100644 --- a/engine/api/event/event.go +++ b/engine/api/event/event.go @@ -98,10 +98,10 @@ func ResetEventIntegration(ctx context.Context, db gorp.SqlExecutor, eventIntegr kafkaCfg := getKafkaConfig(projInt.Config) kafkaBroker, err := getBroker(ctx, "kafka", kafkaCfg) if err != nil { - return sdk.WrapError(sdk.ErrBadBrokerConfiguration, "cannot get broker for %s and user %s : %v", projInt.Config["broker url"].Value, projInt.Config["username"].Value, err) + return sdk.WrapError(sdk.ErrBadBrokerConfiguration, "cannot get broker for %q and user %q : %v", projInt.Config["broker url"].Value, projInt.Config["username"].Value, err) } if err := brokersConnectionCache.Add(brokerConnectionKey, kafkaBroker, gocache.DefaultExpiration); err != nil { - return sdk.WrapError(sdk.ErrBadBrokerConfiguration, "cannot add broker in cache for %s and user %s : %v", projInt.Config["broker url"].Value, projInt.Config["username"].Value, err) + return sdk.WrapError(sdk.ErrBadBrokerConfiguration, "cannot add broker in cache for %q and user %q : %v", projInt.Config["broker url"].Value, projInt.Config["username"].Value, err) } return nil } @@ -213,11 +213,11 @@ func DequeueEvent(ctx context.Context, db *gorp.DbMap) { kafkaCfg := getKafkaConfig(projInt.Config) kafkaBroker, err := getBroker(ctx, "kafka", kafkaCfg) if err != nil { - log.Error(ctx, "Event.DequeueEvent> cannot get broker for %s and user %s : %v", projInt.Config["broker url"].Value, projInt.Config["username"].Value, err) + log.Error(ctx, "Event.DequeueEvent> cannot get broker for %q and user %q : %v", projInt.Config["broker url"].Value, projInt.Config["username"].Value, err) continue } if err := brokersConnectionCache.Add(brokerConnectionKey, kafkaBroker, gocache.DefaultExpiration); err != nil { - log.Error(ctx, "Event.DequeueEvent> cannot add broker in cache for %s and user %s : %v", projInt.Config["broker url"].Value, projInt.Config["username"].Value, err) + log.Error(ctx, "Event.DequeueEvent> cannot add broker in cache for %q and user %q : %v", projInt.Config["broker url"].Value, projInt.Config["username"].Value, err) continue } brokerConnection = kafkaBroker diff --git a/sdk/hatchery/register.go b/sdk/hatchery/register.go index 67c3237f5f..47cc70a3c9 100644 --- a/sdk/hatchery/register.go +++ b/sdk/hatchery/register.go @@ -74,7 +74,11 @@ loopModels: if err := h.CDSClient().WorkerModelBook(models[k].Group.Name, models[k].Name); err != nil { ctx := log.ContextWithStackTrace(ctx, err) - log.Error(ctx, "cannot book model %s with id %d: %v", models[k].Path(), models[k].ID, err) + if sdk.ErrorIs(err, sdk.ErrWorkerModelAlreadyBooked) { + log.Info(ctx, "worker model already booked. model %s with id %d: %v", models[k].Path(), models[k].ID, err) + } else { + log.Error(ctx, "cannot book model %s with id %d: %v", models[k].Path(), models[k].ID, err) + } continue }