fix(semaphore): Fix semaphore reopens after forget#8021
Merged
Darksonn merged 2 commits intotokio-rs:masterfrom Apr 8, 2026
Merged
fix(semaphore): Fix semaphore reopens after forget#8021Darksonn merged 2 commits intotokio-rs:masterfrom
Darksonn merged 2 commits intotokio-rs:masterfrom
Conversation
Member
|
Oh I didn't see you submitted a PR for the bug, so now we have two fixes: #8022. I'll take your fix, but do you mind copying over the tests I wrote, as they are more exhaustive. |
Contributor
Author
Yeah sure absolutely! Thank you so much for the kindness! |
adriandomc
added a commit
to adriandomc/coontext
that referenced
this pull request
Apr 8, 2026
Dependabot PR #5 (closed as a side effect of the earlier force-push). Patch bump within the 1.x line — no API changes. Upstream release notes call out: - sync: fix semaphore reopens after forget (tokio-rs/tokio#8021) - net: surface errors from SO_ERROR on recv for UDP sockets on Linux (tokio-rs/tokio#8001) Neither affects Coontext directly (we don't use semaphores or UDP), but the patch is free. Also tightens the manifest version floor from 1.40 to 1.51 to document the actual minimum we now rely on. Verified locally on macOS: - cargo fmt --all -- --check clean - cargo clippy --all-targets -- -D warnings clean - cargo test --lib 104 passed, 0 failed Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Dicklesworthstone
added a commit
to Dicklesworthstone/meta_skill
that referenced
this pull request
Apr 10, 2026
tokio 1.51.1 includes: - sync: fix semaphore reopens after forget (tokio-rs/tokio#8021) - net: surface errors from SO_ERROR on recv for UDP sockets on Linux - rt: do not leak fd when cancelling io_uring open operation - runtime: steal tasks from LIFO slot, stabilize LocalRuntime semver 1.0.28 is documentation-only; picked up for currency. Applied independently (not via Dependabot merge) per contribution policy. Closes #81, #82. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Closes #8020
Current
forget_semaphoresdoesn't consider LSB (Least Significant Bit), which is used to store semaphore open or closed, which leads to a weird behavior that semaphore reopens.Solution
This PR sets the "closed" bit on
forget_semaphores, another alternative I considered is to return error on close, but that seems to be an interface change which I'd like to avoid.