Skip to content

waker: wake the previous task when register replaces it - #49

Open
fengqiaoqu wants to merge 2 commits into
embassy-rs:mainfrom
fengqiaoqu:fix/iface-waker-wake-previous-48
Open

fengqiaoqu wants to merge 2 commits into
embassy-rs:mainfrom
fengqiaoqu:fix/iface-waker-wake-previous-48

Conversation

@fengqiaoqu

Copy link
Copy Markdown

Summary

Iface::register_waker stores a single WakerRegistration. When a second task registered (as embassy-net's wait_config_up / wait_link_up do through wait_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

Fixes #48

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
@embassy-bot

embassy-bot Bot commented Nov 4, 2026

Copy link
Copy Markdown

👋 Welcome, @fengqiaoqu, and thanks for opening your first pull request here!

If you haven't already, please give the contributor guide a read.

@embassy-bot

embassy-bot Bot commented Nov 4, 2026

Copy link
Copy Markdown

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.
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.

Iface::register_waker keeps one waker, so a second task waiting on the interface hangs the first

1 participant