Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions submitqueue/orchestrator/controller/batch/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func (c *Controller) Process(ctx context.Context, delivery consumer.Delivery) er
return fmt.Errorf("payload queue %q does not match queue %q of request %s", rid.Queue, request.Queue, request.ID)
}

c.logger.Infow("received batch event",
c.logger.Debugw("received batch event",
"request_id", request.ID,
"queue", request.Queue,
"state", string(request.State),
Expand All @@ -128,7 +128,7 @@ func (c *Controller) Process(ctx context.Context, delivery consumer.Delivery) er
// If cancellation races with an attempt already initializing below, speculate re-checks the contained request state before starting work.
if entity.IsRequestStateHalted(request.State) {
metrics.NamedCounter(c.metricsScope, opName, "skipped_halted", 1, metrics.TagsFromContext(ctx)...)
c.logger.Infow("skipping batch for halted request",
c.logger.Debugw("skipping batch for halted request",
"request_id", request.ID,
"state", string(request.State),
)
Expand Down Expand Up @@ -199,13 +199,6 @@ func (c *Controller) Process(ctx context.Context, delivery consumer.Delivery) er
return fmt.Errorf("failed to publish batch ID to dependency-analysis topic: %w", err)
}

c.logger.Infow("published batch to dependency-analysis topic",
"batch_id", batch.ID,
"request_id", request.ID,
"queue", request.Queue,
"topic_key", topickey.TopicKeyDependencyAnalysis,
)

return nil // Success - message will be acked
}

Expand Down
4 changes: 2 additions & 2 deletions submitqueue/orchestrator/controller/build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ func (c *Controller) startPath(ctx context.Context, store orchstorage.Storage, b
}

metrics.NamedCounter(c.metricsScope, opName, "build_triggered", 1, metrics.TagsFromContext(ctx)...)
c.logger.Infow("triggered build for speculation path",
c.logger.Debugw("triggered build for speculation path",
"batch_id", batch.ID,
"path_id", entry.ID,
"attempt", entry.Attempt,
Expand Down Expand Up @@ -338,7 +338,7 @@ func (c *Controller) ensureSignal(ctx context.Context, store orchstorage.Storage
}

metrics.NamedCounter(c.metricsScope, opName, "signal_ensured", 1, metrics.TagsFromContext(ctx)...)
c.logger.Debugw("re-published build signal on redelivery",
c.logger.Infow("re-published build signal on redelivery",
"batch_id", batch.ID,
"path_id", entry.ID,
"attempt", entry.Attempt,
Expand Down
12 changes: 3 additions & 9 deletions submitqueue/orchestrator/controller/buildsignal/buildsignal.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,6 @@ func (c *Controller) Process(ctx context.Context, delivery consumer.Delivery) er
return fmt.Errorf("failed to get build %s: %w", buildID.ID, err)
}

c.logger.Debugw("polling build status",
"build_id", build.ID,
"batch_id", build.BatchID,
"attempt", delivery.Attempt(),
"partition_key", msg.PartitionKey,
)

// Load the batch first: it gives us the queue (needed to build the right
// BuildRunner) and lets us short-circuit halted batches before polling.
batch, err := store.GetBatchStore().Get(ctx, build.BatchID)
Expand Down Expand Up @@ -219,7 +212,7 @@ func (c *Controller) Process(ctx context.Context, delivery consumer.Delivery) er
)
} else {
metrics.NamedCounter(c.metricsScope, opName, "build_cancelled", 1, metrics.TagsFromContext(ctx)...)
c.logger.Infow("requested cancellation of a build nothing wants running",
c.logger.Debugw("requested cancellation of a build nothing wants running",
"build_id", build.ID,
"batch_id", build.BatchID,
"path_id", build.PathID,
Expand Down Expand Up @@ -264,7 +257,7 @@ func (c *Controller) Process(ctx context.Context, delivery consumer.Delivery) er

if status.IsTerminal() {
metrics.NamedCounter(c.metricsScope, opName, "terminal", 1, metrics.TagsFromContext(ctx, metrics.NewTag("status", string(status)))...)
c.logger.Infow("build reached terminal status",
c.logger.Debugw("build reached terminal status",
"build_id", build.ID,
"batch_id", build.BatchID,
"status", string(status),
Expand All @@ -280,6 +273,7 @@ func (c *Controller) Process(ctx context.Context, delivery consumer.Delivery) er

c.logger.Debugw("holding for next build status poll",
"build_id", build.ID,
"attempt", delivery.Attempt(),
"status", string(status),
"delay_ms", delayMs,
)
Expand Down
19 changes: 10 additions & 9 deletions submitqueue/orchestrator/controller/cancel/cancel.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func (c *Controller) Process(ctx context.Context, delivery consumer.Delivery) er
return fmt.Errorf("payload queue %q does not match queue %q of request %s", cancelReq.Queue, request.Queue, request.ID)
}

c.logger.Infow("received cancel event",
c.logger.Debugw("received cancel event",
"request_id", request.ID,
"queue", request.Queue,
"state", string(request.State),
Expand Down Expand Up @@ -174,7 +174,7 @@ func (c *Controller) Process(ctx context.Context, delivery consumer.Delivery) er
}

// Return the first failure so the existing linear error-classification chain remains intact.
// Matches are sorted by ID below, making the selected error deterministic while every failure is still logged and counted.
// FindByRequestID sorts by ID, so the selected error is deterministic. The consumer logs the returned failure, later failures are logged here, and every failure is counted.
var firstErr error
foundApplicableBatch := false
for _, batch := range batches {
Expand All @@ -183,13 +183,14 @@ func (c *Controller) Process(ctx context.Context, delivery consumer.Delivery) er
foundApplicableBatch = true
if err := c.cancelBatch(ctx, store, batch); err != nil {
metrics.NamedCounter(c.metricsScope, opName, "batch_cancel_errors", 1, metrics.TagsFromContext(ctx)...)
c.logger.Errorw("failed to cancel batch",
"batch_id", batch.ID,
"batch_state", string(batch.State),
"error", err,
)
if firstErr == nil {
firstErr = err
} else {
c.logger.Warnw("failed to cancel batch",
"batch_id", batch.ID,
"batch_state", string(batch.State),
"error", err,
)
}
}
case batch.State == entity.BatchStateLanding:
Expand Down Expand Up @@ -275,7 +276,7 @@ func (c *Controller) cancelRequest(ctx context.Context, store orchstorage.Storag

switch res.Outcome {
case corerequest.TerminationOutcomeSuccess, corerequest.TerminationOutcomeAlreadyInTargetState:
c.logger.Infow("request cancelled (not batched)",
c.logger.Debugw("request cancelled (not batched)",
"request_id", request.ID,
"queue", request.Queue,
)
Expand Down Expand Up @@ -311,7 +312,7 @@ func (c *Controller) cancelRequest(ctx context.Context, store orchstorage.Storag
// intent CAS is skipped and we just re-publish — speculate absorbs the
// duplicate as a cheap no-op nudge.
func (c *Controller) cancelBatch(ctx context.Context, store orchstorage.Storage, batch entity.Batch) error {
c.logger.Infow("handing batch cancellation off to speculate",
c.logger.Debugw("handing batch cancellation off to speculate",
"batch_id", batch.ID,
"queue", batch.Queue,
"batch_state", string(batch.State),
Expand Down
2 changes: 1 addition & 1 deletion submitqueue/orchestrator/controller/conclude/conclude.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (c *Controller) Process(ctx context.Context, delivery consumer.Delivery) er
return fmt.Errorf("payload queue %q does not match queue %q of batch %s", bid.Queue, batch.Queue, batch.ID)
}

c.logger.Infow("received conclude event",
c.logger.Debugw("received conclude event",
"batch_id", batch.ID,
"queue", batch.Queue,
"state", string(batch.State),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func (c *Controller) Process(ctx context.Context, delivery consumer.Delivery) er
return fmt.Errorf("payload queue %q does not match queue %q of batch %s", bid.Queue, batch.Queue, batch.ID)
}

c.logger.Infow("received dependency-analysis event",
c.logger.Debugw("received dependency-analysis event",
"batch_id", batch.ID,
"queue", batch.Queue,
"state", string(batch.State),
Expand Down Expand Up @@ -177,7 +177,7 @@ func (c *Controller) Process(ctx context.Context, delivery consumer.Delivery) er
// Nothing has claimed the request yet, so cancel owned it outright and
// has already written its outcome.
metrics.NamedCounter(c.metricsScope, opName, "skipped_halted_request", 1, metrics.TagsFromContext(ctx)...)
c.logger.Infow("abandoning batch; contained request is halted",
c.logger.Debugw("abandoning batch; contained request is halted",
"batch_id", batch.ID,
"request_id", halted,
)
Expand Down Expand Up @@ -220,7 +220,7 @@ func (c *Controller) Process(ctx context.Context, delivery consumer.Delivery) er
RecordValue(float64(len(batch.Contains)))
metrics.NamedHistogram(c.metricsScope, "batch_shape", "dependencies", metrics.CountBuckets, metrics.TagsFromContext(ctx)...).
RecordValue(float64(len(batch.Dependencies)))
c.logger.Infow("batch created",
c.logger.Debugw("batch created",
"batch_id", batch.ID,
"queue", batch.Queue,
"dependency_count", len(batch.Dependencies),
Expand Down Expand Up @@ -467,11 +467,6 @@ func (c *Controller) publishToSpeculate(ctx context.Context, batch entity.Batch)
metrics.NamedCounter(c.metricsScope, opName, "publish_errors", 1, metrics.TagsFromContext(ctx)...)
return fmt.Errorf("failed to publish batch ID to speculate topic: %w", err)
}

c.logger.Infow("published batch to speculate topic",
"batch_id", batch.ID,
"topic_key", topickey.TopicKeySpeculate,
)
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion submitqueue/orchestrator/controller/dlq/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (c *batchController) Process(ctx context.Context, delivery consumer.Deliver

lastError, failureMeta := failureContext(delivery)
dmeta := delivery.Metadata()
c.logger.Warnw("dlq message received",
c.logger.Debugw("dlq message received",
"batch_id", bid.ID,
"attempt", delivery.Attempt(),
"dlq_original_topic", dmeta["dlq.original_topic"],
Expand Down
2 changes: 1 addition & 1 deletion submitqueue/orchestrator/controller/dlq/buildsignal.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (c *buildSignalController) Process(ctx context.Context, delivery consumer.D

lastError, failureMeta := failureContext(delivery)
dmeta := delivery.Metadata()
c.logger.Warnw("dlq message received",
c.logger.Debugw("dlq message received",
"build_id", buildID.ID,
"attempt", delivery.Attempt(),
"dlq_original_topic", dmeta["dlq.original_topic"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func (c *dependencyAnalysisController) Process(ctx context.Context, delivery con

lastError, failureMeta := failureContext(delivery)
dmeta := delivery.Metadata()
c.logger.Warnw("dlq message received",
c.logger.Debugw("dlq message received",
"batch_id", bid.ID,
"attempt", delivery.Attempt(),
"dlq_original_topic", dmeta["dlq.original_topic"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (c *landConflictSignalController) Process(ctx context.Context, delivery con

lastError, failureMeta := failureContext(delivery)
dmeta := delivery.Metadata()
c.logger.Warnw("dlq message received",
c.logger.Debugw("dlq message received",
"request_id", result.Id,
"attempt", delivery.Attempt(),
"dlq_original_topic", dmeta["dlq.original_topic"],
Expand Down
2 changes: 1 addition & 1 deletion submitqueue/orchestrator/controller/dlq/landsignal.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (c *landSignalController) Process(ctx context.Context, delivery consumer.De

lastError, failureMeta := failureContext(delivery)
dmeta := delivery.Metadata()
c.logger.Warnw("dlq message received",
c.logger.Debugw("dlq message received",
"batch_id", result.Id,
"attempt", delivery.Attempt(),
"dlq_original_topic", dmeta["dlq.original_topic"],
Expand Down
2 changes: 1 addition & 1 deletion submitqueue/orchestrator/controller/dlq/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func (c *requestController) Process(ctx context.Context, delivery consumer.Deliv

lastError, failureMeta := failureContext(delivery)
dmeta := delivery.Metadata()
c.logger.Warnw("dlq message received",
c.logger.Debugw("dlq message received",
"request_id", rid.ID,
"attempt", delivery.Attempt(),
"dlq_original_topic", dmeta["dlq.original_topic"],
Expand Down
2 changes: 1 addition & 1 deletion submitqueue/orchestrator/controller/dlq/speculate.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func (c *speculateController) Process(ctx context.Context, delivery consumer.Del
culprits, attribution := c.blame(delivery, bid.ID)
failureMeta["dlq.attribution"] = attribution

c.logger.Warnw("dlq message received",
c.logger.Debugw("dlq message received",
"batch_id", bid.ID,
"queue", bid.Queue,
"attempt", delivery.Attempt(),
Expand Down
10 changes: 2 additions & 8 deletions submitqueue/orchestrator/controller/land/land.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func (c *Controller) Process(ctx context.Context, delivery consumer.Delivery) er
return fmt.Errorf("payload queue %q does not match queue %q of batch %s", bid.Queue, batch.Queue, batch.ID)
}

c.logger.Infow("received land event",
c.logger.Debugw("received land event",
"batch_id", batch.ID,
"queue", batch.Queue,
"state", string(batch.State),
Expand All @@ -143,7 +143,7 @@ func (c *Controller) Process(ctx context.Context, delivery consumer.Delivery) er
// at this stage simply acks.
if entity.IsBatchStateHalted(batch.State) {
metrics.NamedCounter(c.metricsScope, opName, "skipped_halted", 1, metrics.TagsFromContext(ctx)...)
c.logger.Infow("skipping land for halted batch",
c.logger.Debugw("skipping land for halted batch",
"batch_id", batch.ID,
"state", string(batch.State),
)
Expand Down Expand Up @@ -174,12 +174,6 @@ func (c *Controller) Process(ctx context.Context, delivery consumer.Delivery) er
return fmt.Errorf("failed to publish to runway merge: %w", err)
}

c.logger.Infow("published merge request to Runway",
"batch_id", batch.ID,
"steps", len(req.Steps),
"topic_key", c.runwayTopicKey,
)

return nil // Success - message will be acked
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func (c *Controller) Process(ctx context.Context, delivery consumer.Delivery) er
return fmt.Errorf("failed to get request %s: %w", result.Id, err)
}

c.logger.Infow("received landconflict signal",
c.logger.Debugw("received landconflict signal",
"request_id", request.ID,
"landable", result.Outcome == runwaypb.Outcome_SUCCEEDED,
"attempt", delivery.Attempt(),
Expand All @@ -121,7 +121,7 @@ func (c *Controller) Process(ctx context.Context, delivery consumer.Delivery) er

if entity.IsRequestStateHalted(request.State) {
metrics.NamedCounter(c.metricsScope, opName, "skipped_halted", 1, metrics.TagsFromContext(ctx)...)
c.logger.Infow("skipping landconflict signal for halted request",
c.logger.Debugw("skipping landconflict signal for halted request",
"request_id", request.ID,
"state", string(request.State),
)
Expand All @@ -130,7 +130,7 @@ func (c *Controller) Process(ctx context.Context, delivery consumer.Delivery) er

if result.Outcome != runwaypb.Outcome_SUCCEEDED {
metrics.NamedCounter(c.metricsScope, opName, "not_landable", 1, metrics.TagsFromContext(ctx)...)
c.logger.Infow("request not landable",
c.logger.Debugw("request not landable",
"request_id", request.ID,
"reason", result.Reason,
)
Expand Down Expand Up @@ -161,11 +161,6 @@ func (c *Controller) Process(ctx context.Context, delivery consumer.Delivery) er
return fmt.Errorf("failed to publish to batch: %w", err)
}

c.logger.Infow("request validated and published to batch",
"request_id", request.ID,
"topic_key", topickey.TopicKeyBatch,
)

return nil // Success - message will be acked
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (c *Controller) Process(ctx context.Context, delivery consumer.Delivery) er
return fmt.Errorf("failed to get batch %s: %w", result.Id, err)
}

c.logger.Infow("received land signal",
c.logger.Debugw("received land signal",
"batch_id", batch.ID,
"landed", result.Outcome == runwaypb.Outcome_SUCCEEDED,
"state", string(batch.State),
Expand Down Expand Up @@ -155,7 +155,7 @@ func (c *Controller) Process(ctx context.Context, delivery consumer.Delivery) er
var newState entity.BatchState
if result.Outcome == runwaypb.Outcome_SUCCEEDED {
newState = entity.BatchStateSucceeded
c.logger.Infow("landed batch",
c.logger.Debugw("landed batch",
"batch_id", batch.ID,
"steps", result.Steps,
)
Expand Down
2 changes: 1 addition & 1 deletion submitqueue/orchestrator/controller/ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (c *PingController) Ping(ctx context.Context, req *pb.PingRequest) (resp *p

hostname, _ := os.Hostname()

c.logger.Info("ping request received",
c.logger.Debug("ping request received",
zap.String("message", req.Message),
zap.Bool("is_echo", isEcho),
zap.String("hostname", hostname),
Expand Down
4 changes: 2 additions & 2 deletions submitqueue/orchestrator/controller/speculate/finalize.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func (c *Controller) finalizeCancellations(ctx context.Context, snap *snapshot,
// read folded that in — so a path still reading as unstopped really is.
if exists && !allPathsStopped(set) {
metrics.NamedCounter(c.metricsScope, opName, "cancel_awaiting_paths", 1, metrics.TagsFromContext(ctx)...)
c.logger.Infow("cancelling batch; waiting for its builds to stop",
c.logger.Debugw("cancelling batch; waiting for its builds to stop",
"batch_id", batch.ID,
"queue", batch.Queue,
)
Expand Down Expand Up @@ -346,7 +346,7 @@ func (c *Controller) applyOutcome(ctx context.Context, store orchstorage.Storage
}

metrics.NamedCounter(c.metricsScope, opName, "outcome", 1, metrics.TagsFromContext(ctx, metrics.NewTag("outcome", string(decision)))...)
c.logger.Infow("batch outcome",
c.logger.Debugw("batch outcome",
"batch_id", batch.ID,
"queue", batch.Queue,
"outcome", string(decision),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func (c *Controller) admit(ctx context.Context, store orchstorage.Storage, batch
}

metrics.NamedCounter(c.metricsScope, opName, "admitted", 1, metrics.TagsFromContext(ctx)...)
c.logger.Infow("admitted batch to speculation",
c.logger.Debugw("admitted batch to speculation",
"batch_id", updated.ID,
"queue", updated.Queue,
"dependencies", updated.Dependencies,
Expand Down
Loading
Loading