Skip to content

fix(socketcan): support file descriptors above 1023 - #2093

Open
timothyanderson096-ocdealcheck wants to merge 4 commits into
hardbyte:mainfrom
timothyanderson096-ocdealcheck:fix/socketcan-high-fd
Open

fix(socketcan): support file descriptors above 1023#2093
timothyanderson096-ocdealcheck wants to merge 4 commits into
hardbyte:mainfrom
timothyanderson096-ocdealcheck:fix/socketcan-high-fd

Conversation

@timothyanderson096-ocdealcheck

Copy link
Copy Markdown

Summary of Changes

  • Replace SocketCAN's select.select() readiness checks with select.poll() so valid socket file descriptors above FD_SETSIZE are supported.
  • Preserve receive and send timeout behavior by converting seconds to millisecond poll timeouts with ceiling.
  • Add Linux regression tests that duplicate a live socket descriptor to 1024 and exercise both receive and transmit paths.
  • Add the required towncrier news fragment.

Related Issues / Pull Requests

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactoring
  • Other (please describe):

Checklist

  • I have followed the contribution guide.
  • I have added or updated tests as appropriate.
  • I have added or updated documentation as appropriate.
  • I have added a news fragment for towncrier.
  • All checks and tests pass (tox).

Additional Notes

Before this change, the send and receive regression tests both fail at descriptor 1024 with ValueError: filedescriptor out of range in select().

After this change:

  • pytest -q test/test_socketcan.py --no-cov: 10 passed, 3 skipped
  • Full supported suite: 505 passed, 94 skipped, 32 deselected
  • The deselected tests are the two UDP multicast classes, which cannot join a multicast group in the test sandbox.
  • Black passes for the changed source and test files; Ruff and Pylint pass for the SocketCAN implementation.

@mergify

mergify Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6c21eb0545

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread can/interfaces/socketcan/socketcan.py Outdated
Comment thread test/test_socketcan.py
Comment thread can/interfaces/socketcan/socketcan.py Outdated
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.

SocketcanBus does not support socket file descriptors over 1023

1 participant