Skip to content

fix: harden panic recovery before 0.7.0 - #258

Merged
tisonkun merged 6 commits into
apache:mainfrom
tisonkun:codex/harden-0.7.0-release
Aug 31, 2026
Merged

fix: harden panic recovery before 0.7.0#258
tisonkun merged 6 commits into
apache:mainfrom
tisonkun:codex/harden-0.7.0-release

Conversation

@tisonkun

@tisonkun tisonkun commented Aug 31, 2026

Copy link
Copy Markdown
Member

Summary

  • wake every semaphore waiter whose permit was granted even when another registered waker panics
  • leave a watch update unseen until cloning succeeds so a receiver can recover and retry
  • clarify the shipped semaphore panic-recovery fix in the 0.7 changelog
  • require release-tag comparison before agents add future changelog entries

Design Notes

The changes are limited to two reproduced failure modes and do not add or alter public API surface. The shared fan-out helper remains in internal::waitset; its conditional compilation now covers semaphore-backed single-feature builds. The watch correction is intentionally omitted from the changelog because watch has not shipped yet. Repository guidance now makes that release-baseline distinction explicit.

Validation

  • cargo x lint
  • cargo x check
  • cargo x test --no-capture
  • RUSTUP_TOOLCHAIN=1.86.0 cargo x test --no-capture
  • cargo x semver --release-version 0.7.0 --acknowledge-breaking-changes
  • cargo publish --package asyncband --locked --dry-run
  • cargo x miri

Semaphore release marks a batch of waiters ready before invoking their wakers. If one callback panicked, the old batch loop dropped the remaining wakers without notifying them, so executors could leave already-granted acquisitions parked forever. Reuse the panic-preserving fan-out helper for semaphore batches and notify-all paths so every waiter gets a wake attempt before the first panic resumes.

Signed-off-by: tison <wander4096@gmail.com>
Receiver::recv marked a version seen before invoking T::clone. A panicking Clone therefore made a value disappear from that receiver even though recv never returned. Separate waiting from observation and commit the seen version only after cloning succeeds so callers can recover and retry.
Signed-off-by: tison <wander4096@gmail.com>
The existing fan-out entry did not make the semaphore consequence clear, and the watch retry guarantee was absent. Describe both observable fixes so users evaluating the 0.7 upgrade can understand the recovered behavior.

Signed-off-by: tison <wander4096@gmail.com>
The private future represents one pending channel change; WaitForChange repeats the waiting action already expressed by its Future role. Rename it to Change so the implementation reads more directly without affecting behavior or public API.

Signed-off-by: tison <wander4096@gmail.com>
The watch API is new in 0.7.0, so its pre-release clone-panic behavior was never part of a published contract. Keep the regression test and implementation fix, but omit the development-cycle correction from user-facing release notes.

Signed-off-by: tison <wander4096@gmail.com>
The repository had no agent guidance distinguishing release notes from development history. Require comparison with the latest release tag and explicit proof that a bug shipped before adding a bug-fix entry, so unreleased corrections do not leak into the changelog.

Signed-off-by: tison <wander4096@gmail.com>
@tisonkun
tisonkun marked this pull request as ready for review August 31, 2026 17:22
@tisonkun
tisonkun enabled auto-merge (squash) August 31, 2026 17:22
@tisonkun
tisonkun disabled auto-merge August 31, 2026 17:22
@tisonkun
tisonkun enabled auto-merge (squash) August 31, 2026 17:23
@tisonkun
tisonkun merged commit ff8f0f6 into apache:main Aug 31, 2026
10 checks passed
@tisonkun
tisonkun deleted the codex/harden-0.7.0-release branch August 31, 2026 17:31
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