Skip to content

fix: explicit panic on empty Selector - #179

Merged
zesterer merged 1 commit into
zesterer:masterfrom
rumpuslabs:empty-select
Apr 16, 2026
Merged

zesterer merged 1 commit into
zesterer:masterfrom
rumpuslabs:empty-select

Conversation

@rumpuslabs

Copy link
Copy Markdown
Contributor

Fixes #176.

An empty Selector is causing a panic in 0.12.0 with the eventual-fairness feature, due to the new RNG not accepting an empty range. Without the eventual-fairness feature, it maintains the old behaviour; wait() blocks forever and the timeout/deadline functions wait their full timeout.

I have fixed the eventual-fairness panic, and added an explicit panic if wait() is called on an empty Selector since this would otherwise block forever. I've also documented the (existing) behaviour of wait_timeout and wait_deadline with an empty Selector.

@zesterer

zesterer commented Apr 16, 2026 •

Copy link
Copy Markdown
Owner

Thanks! These changes look sensible to me.

Sorry I'd not got to this faster: I've a lot of commitments right now and no longer have much time for this project.

@zesterer
zesterer merged commit f5a85c7 into zesterer:master Apr 16, 2026
4 checks passed
@rumpuslabs
rumpuslabs deleted the empty-select branch April 21, 2026 00:50
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.

0.12.0 regression: Selector::wait_timeout on an empty Selector hangs forever

2 participants