Skip to content

pkg/service: downgrade bundle status log when bundle deleted concurrently - #392

Closed
yi-chen-roger wants to merge 1 commit into
open-policy-agent:mainfrom
yi-chen-roger:ychen/bundle-status-race-log-fix
Closed

pkg/service: downgrade bundle status log when bundle deleted concurrently#392
yi-chen-roger wants to merge 1 commit into
open-policy-agent:mainfrom
yi-chen-roger:ychen/bundle-status-race-log-fix

Conversation

@yi-chen-roger

Copy link
Copy Markdown
Contributor

Summary

  • UpsertBundleStatus fails with sql.ErrNoRows when a bundle's config row is deleted (e.g. by another process sharing the database) while a worker run for that bundle is still in flight.
  • This is an expected race, not an operational issue — the bundle is already gone, so there's nothing to track. Log it at debug level instead of warn to stop it from being noisy/alert-worthy while keeping other status-tracking failures at warn.

Test plan

  • go build ./...
  • go test ./pkg/service/... -run TestBundleWorkerExecute
  • gofmt -l pkg/service/worker.go (no output)

…ntly

UpsertBundleStatus can fail with sql.ErrNoRows when the bundle row is
removed by another process while a worker's run is still in flight.
This is an expected race, not an operational problem, so log it at
debug level instead of warn to avoid noisy/alerting warnings.

Signed-off-by: Yi Chen <yi.chen.roger@gmail.com>
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.

1 participant