Skip to content

cunit-net-timers: a timer request is its owner's alone - #2451

Open
JJDSNT wants to merge 1 commit into
aros-development-team:masterfrom
JJDSNT:review/arostcp-timers-test
Open

JJDSNT wants to merge 1 commit into
aros-development-team:masterfrom
JJDSNT:review/arostcp-timers-test

Conversation

@JJDSNT

@JJDSNT JJDSNT commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

A regression test only, no change to the stack. 64d00bf2da made the stack's timer requests its own task's alone: until then tcp_timer_want(), called by an application's send(), could abort, collect and send the retransmission request in the application's task, and all the stack's timers could stop for good. Nothing tested it.

cunit-net-timers reads the stack's counters (kern/netdiag.h), in place. A stack without them: the tests are skipped.

  • another task's deadline is the owner's work: send() asks for an earlier deadline from the application's task, and the owner must be signalled for it;
  • the timers run on under load: four tasks send over loopback for 4 s; the timers must run during it and after it, no request lost or out twice.

Validation

first test second test
linux-x86_64 hosted, three runs pass pass
m68k, emulated A3000, one run pass pass
mutant 1: tcp_timer_want() collects and sends the request in the caller's task; hosted, three runs fails pass
mutant 2: mutant 1, and timer_poll() takes the reply before splsoftclock(); hosted, three runs fails pass

The stack in these runs was a master of before #2448, which changes nothing in kern/; the A3000's 83004d5cc9, with the transport.prot of #2449. The mutants were not run on the A3000.

Limit: the second test does not catch either mutant: the race itself is too narrow to be hit on purpose. It is the first that guards the fix; the second checks that the timers go on.

Not tested: real hardware.

An application's send() may ask for an earlier retransmission deadline;
the stack's task must be signalled for it (tcp_timer_want()). And under
load from several tasks the timers run on, none lost and none twice. Read
from the stack's counters (kern/netdiag.h). With tcp_timer_want() aborting
and sending the request in the caller's task again, the first test fails.
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