Skip to content

Prevent panic on PermissionDenied in selector.rs#5

Open
ReinierMaas wants to merge 1 commit intoreinier/update-futures-litefrom
reinier/prevent-segfault
Open

Prevent panic on PermissionDenied in selector.rs#5
ReinierMaas wants to merge 1 commit intoreinier/update-futures-litefrom
reinier/prevent-segfault

Conversation

@ReinierMaas
Copy link

Applies changes from: sagebind#462

We are running into the same issue as described in those PRs and linked issues

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 268 to 271
match error.kind() {
// Common error codes std understands.
io::ErrorKind::NotFound | io::ErrorKind::InvalidInput => true,
io::ErrorKind::NotFound | io::ErrorKind::InvalidInput | io::ErrorKind::PermissionDenied => true,

Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is_bad_socket_error now treats io::ErrorKind::PermissionDenied as a "bad socket" for all poller operations (including register), not just delete. This broadens the previous behavior (which only ignored PermissionDenied during deregister) and can mask genuine permission/configuration errors by causing register to silently accept the socket and keep retrying it via bad_sockets. If the intent is only to ignore spurious PermissionDenied on removal, consider handling PermissionDenied specifically in deregister (as before) or gating it to the exact platform/error code(s) observed for invalid handles (e.g., Windows-specific) rather than treating all PermissionDenied as an invalid/closed socket.

Copilot uses AI. Check for mistakes.
…ad_socket_error` return `true` on `std::io::ErrorKind::PermissionDenied`. `poller.add` and/or `poller.modify` return `std::io::ErrorKind::PermissionDenied` in certain conditions.
@ReinierMaas ReinierMaas force-pushed the reinier/prevent-segfault branch from aa36087 to ea27124 Compare February 24, 2026 13:41
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.

3 participants