Open
Conversation
62b2f8f to
dffee87
Compare
dffee87 to
8622684
Compare
eval-exec
reviewed
Mar 4, 2026
There was a problem hiding this comment.
Pull request overview
Fixes a deadlock in yamux::StreamHandle when the handle is split into read/write halves: the write side previously polled frame_receiver with the write task’s waker, overwriting the read side’s waker and preventing reads from being awakened.
Changes:
- Refactors frame draining on the write side to use a non-waker-registering path (
try_recv_frames) to avoid overwriting the read task’s waker. - Adds deterministic regression tests in
yamux/src/stream.rsvalidating correct waker behavior across split read/write polling. - Adds
tentacleintegration tests (behindunstable) exercising first-message and multi-message spawn flows; bumpssocket2dependency.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
yamux/src/stream.rs |
Introduces try_recv_frames and adjusts waker registration/wake-up behavior; adds multiple regression tests. |
tentacle/tests/test_spawn_first_message.rs |
Adds integration tests covering the spawn-based first message and sustained bidirectional messaging paths. |
tentacle/Cargo.toml |
Updates socket2 from 0.5.0 to 0.6.0. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
When
self.recv_frames_wake(cx)is called on the write side, it passes the write side's context/waker to the channel. This overwrites the read side's waker, preventing the message from waking up and causing messages to be unreadable. This PR fixes this overwriting error and provides several test cases to ensure correct behavior.Just so you know, this problem only manifests when the
StreamHandleis split; when it's not split, reading and writing share a single waker without issue.