Skip to content

fix: release flights after compute panic - #9

Merged
agkloop merged 1 commit into
mainfrom
fix-compute-panic-flight
Sep 2, 2026
Merged

fix: release flights after compute panic#9
agkloop merged 1 commit into
mainfrom
fix-compute-panic-flight

Conversation

@agkloop

@agkloop agkloop commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Why

A panic from a foreground GetOrCompute computation left its single-flight entry unfinished. Later calls for the same key could block forever.

What changed

  • Preserve and re-panic the original value for the computing caller and same-flight followers.
  • Remove the failed flight before releasing waiters.
  • Cache no value or error after a panic, so a later call can retry normally.
  • Keep background-refresh panic behavior unchanged.
  • Document the behavior and add regression coverage for panic propagation and retry.

Validation

  • go test ./... -count=1
  • go test ./... -race -count=1
  • Redis adapter tests and race tests
  • Focused panic tests repeated 100 times under the race detector
  • go vet ./...
  • docs/skill sync check
  • benchmark smoke: hot hits remain zero-allocation

@agkloop
agkloop merged commit d4e586a into main Sep 2, 2026
5 checks passed
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