Skip to content

doip: a tester that stops reading holds the others up 1 s, not 10 - #37

Merged
tkeairns merged 1 commit into
mainfrom
fix/doip-send-timeout
Dec 2, 2026
Merged

tkeairns merged 1 commit into
mainfrom
fix/doip-send-timeout

Conversation

@tkeairns

@tkeairns tkeairns commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

What

CONFIG_NET_CONTEXT_SNDTIMEO=y in the ethernet snippet, and a test of a tester that stops reading.

Why

lib/doip sets SO_SNDTIMEO to 1 s so that a tester that stops reading its socket is closed rather than waited on. Zephyr refuses that option unless CONFIG_NET_CONTEXT_SNDTIMEO is built in, and the result was not checked. A blocked send then waits the stack's default, CONFIG_NET_SOCKET_MAX_SEND_WAIT, 10 s, and the DoIP thread answers no other tester meanwhile. UDS on CAN has its own thread and was not affected.

Tested

NUCLEO-H753ZI, one tester sending 600 requests and reading none, a second tester asking TesterPresent throughout:

The second tester's slowest answer
before 10.06 s
after 1.04 s
  • testing/suites/doip/test_entity.py: 11 passed on the board (twice) and on the Renode bench. The new test fails without the option.

Note

The stalled connection's remaining bytes stay queued in the stack after the entity closes it, until the tester reads or closes. The entity's own socket count drops at once, which is what the test checks.

SO_SNDTIMEO needs CONFIG_NET_CONTEXT_SNDTIMEO: without it the option is
refused and a blocked send waits CONFIG_NET_SOCKET_MAX_SEND_WAIT, 10 s,
with every other tester unanswered meanwhile.
@tkeairns
tkeairns marked this pull request as ready for review December 2, 2026 18:55
@tkeairns
tkeairns merged commit b52901a into main Dec 2, 2026
8 checks passed
@tkeairns
tkeairns deleted the fix/doip-send-timeout branch December 2, 2026 23:39
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.

1 participant