Repository navigation
waker: wake the previous task when register replaces it - #49
Open
fengqiaoqu wants to merge 2 commits into
Open
fengqiaoqu wants to merge 2 commits into
fengqiaoqu wants to merge 2 commits into
Conversation
Iface::register_waker keeps a single WakerRegistration. When a second task registered, the first waker was dropped without a wake, so that task hung forever (for example two embassy-net wait_config_up waiters). Wake the old waker on replace, matching embassy-sync. Same-task re-register still skips the clone. Adds unit coverage and the iface regression from embassy-rs#48. Fixes embassy-rs#48
|
👋 Welcome, @fengqiaoqu, and thanks for opening your first pull request here! If you haven't already, please give the contributor guide a read. |
|
CI on this pull request is failing, so it isn't in the review queue yet. A pull request needs passing CI to be queued for review — push a fix and it'll be added automatically. |
Unblocks CI fmt check so the PR can enter the embassy review queue.
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.
Summary
Iface::register_wakerstores a singleWakerRegistration. When a second task registered (as embassy-net'swait_config_up/wait_link_updo throughwait_iface), the first waker was overwritten and dropped without being woken, so that task never polled again after a config or link change.This matches
embassy_sync::waitqueue::WakerRegistration: on replace, wake the previous task so it can poll and re-register if it still cares. Same-task re-register still keeps the existing waker (no clone). Socket RX/TX/accept registrations share this type and get the same behaviour, which is what embassy-net had on smoltcp.Test plan
cargo test --lib -- waker::tests config_change_wakes_every_waiter— 3 new tests passcargo test --lib— 777 passed (774 prior + 3 new)add_ip_addr; both wake counts are 1Fixes #48