Skip to content

fix: prevent busy loop in default wait_for_update impl#194

Merged
brendanjryan merged 2 commits intotempoxyz:mainfrom
evchip:fix/default-wait-for-update-busy-loop
Apr 7, 2026
Merged

fix: prevent busy loop in default wait_for_update impl#194
brendanjryan merged 2 commits intotempoxyz:mainfrom
evchip:fix/default-wait-for-update-busy-loop

Conversation

@evchip
Copy link
Copy Markdown
Contributor

@evchip evchip commented Apr 7, 2026

The default wait_for_update() on ChannelStore returns immediately (Box::pin(async {})), which causes the tokio::select! in serve() to never hit the sleep branch, resulting in a busy loop instead of 100ms polling.

This PR fixes this by changing the default to std::future::pending(), which never completes, so the sleep branch always wins the select!.

Closes issue #193

@brendanjryan
Copy link
Copy Markdown
Collaborator

brendanjryan commented Apr 7, 2026

LGTM -- thanks for the submission!

Can you add a changelog entry?

@evchip
Copy link
Copy Markdown
Contributor Author

evchip commented Apr 7, 2026

Can you add a changelog entry?

Added it under a 0.8.5 patch release. Let me know if you'd like it written a different way @brendanjryan

@evchip evchip force-pushed the fix/default-wait-for-update-busy-loop branch from 9039836 to b3fd45c Compare April 7, 2026 03:14
@evchip
Copy link
Copy Markdown
Contributor Author

evchip commented Apr 7, 2026

Rebased on main and replaced the CHANGELOG.md edit with a .changelog/ entry per the release workflow @brendanjryan

@brendanjryan brendanjryan merged commit e46e4f4 into tempoxyz:main Apr 7, 2026
7 checks passed
@github-actions github-actions bot mentioned this pull request Apr 7, 2026
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.

2 participants