Skip to content

Clean up logging in controller and wrap errors#132

Open
yushan8 wants to merge 12 commits into
mainfrom
update-logging
Open

Clean up logging in controller and wrap errors#132
yushan8 wants to merge 12 commits into
mainfrom
update-logging

Conversation

@yushan8

@yushan8 yushan8 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor
  • Replaced common.WithReason with fmt.Errorf for error wrapping in getchangedtargets.go and getGraph.
  • Promoted silent failures to hard errors — cache read failures, corrupt blobs, and cachedReader.Close() errors now return instead of logging and falling through.
  • Surfaced ws.Release() errors in native_orchestrator.go via multierr.Append instead of swallowing them.
  • Added logger.Error at each error return in top-level controller (GetTargetGraph, GetChangedTargets) with specific failure messages.
  • Removed non-actionable logs — cache miss debug logs, bypass_cache logs, context cancelled logs.
  • Removed unused logger param from compareTargetGraphs.
  • Updated tests to match new error wrapping and removed ClassifiedError assertions where common.WithReason was replaced.

@yushan8 yushan8 requested review from a team as code owners June 30, 2026 22:36
Comment thread controller/getchangedtargets.go
Comment thread controller/getchangedtargets.go Outdated
Comment thread orchestrator/BUILD.bazel Outdated
Comment thread controller/getchangedtargets.go Outdated
if cacheErr != nil && !storage.IsNotFound(cacheErr) {
logger.Warn("GetChangedTargets: Failed to read from cache, proceeding to compute", zap.Error(cacheErr))
logger.Error("GetChangedTargets: failed to read from cache", zap.Error(cacheErr))
return fmt.Errorf("failed to read from cache: %w", cacheErr)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should still fall through and continue to compute in this case if storage read errors out

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea I think if there's an actual storage failure, it'll be caught in getGraph anyways.

Comment thread controller/getchangedtargets.go Outdated
scope.Histogram("total_duration.histogram", c.totalDurationBuckets).RecordDuration(totalDuration)
return nil
logger.Error("GetChangedTargets: failed to read cached response", zap.Error(readErr))
return fmt.Errorf("read cached response: %w", readErr)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, any kind of transient storage blip that used to digrade gracefully now hard fails

err := ws.Release()
if err != nil {
// clean up the workspace if release fails.
if releaseErr := ws.Release(); releaseErr != nil {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This too. workspace Release shoudn't fail the request when the compute result is already put in storage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants