Prevent panic on PermissionDenied in selector.rs#5
Prevent panic on PermissionDenied in selector.rs#5ReinierMaas wants to merge 1 commit intoreinier/update-futures-litefrom
PermissionDenied in selector.rs#5Conversation
There was a problem hiding this comment.
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.
| 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, | ||
|
|
There was a problem hiding this comment.
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.
…ad_socket_error` return `true` on `std::io::ErrorKind::PermissionDenied`. `poller.add` and/or `poller.modify` return `std::io::ErrorKind::PermissionDenied` in certain conditions.
aa36087 to
ea27124
Compare
Applies changes from: sagebind#462
We are running into the same issue as described in those PRs and linked issues