You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Stop the HTTP test environment's tasks when it is dropped without stop() #2471
Parent EPIC: #1488. A gap that predates SI-16 (#2412, PR #2439): the HTTP test environment never stopped its server when dropped without stop(). An earlier version of this issue called it a regression from SI-16; PR #2544 review finding F5 showed that was wrong.
Goal
Dropping a running HTTP test environment (axum-http-server's testing::environment) without calling stop() stops its HTTP server and statistics event listener, as dropping the UDP test environment does, so the HTTP binding is released.
Bug
The running state holds a plain CancellationToken. Dropping a token does not cancel it, and dropping the task handles detaches the tasks, so the HTTP server keeps running and keeps its binding until the Tokio runtime shuts down. Reproduced on develop at 24bf4746a: after dropping a started environment, binding its address every 10 ms for 10 s never succeeded.
Before PR #2439, the running state held the legacy halt sender. Dropping it made torrust-server-lib's shutdown_signal panic inside the spawned shutdown task, before the task stopped the server, so the server kept serving; running the same drop test on the tree before SI-16 shows the binding still taken after 10 s. The UDP environment stops on drop because its legacy launcher treats a closed halt channel as a stop, and PR #2459 (finding F1) gave it a DropGuard. This issue aligns HTTP with UDP.
Impact: test-only and low; each test runtime stops the leaked tasks when the test ends.
Acceptance criteria
AC1: Dropping a running HTTP test environment without stop() releases its HTTP binding within the test deadline.
AC2: stop() keeps its behavior: it cancels once, joins every owned task, and reports failures as today; all existing environment tests pass.
AC3: The regression test is proven red before the fix and green after.
linter all exits with code 0
Relevant tests pass
Manual verification scenarios are executed and documented in issue-local manual-verification-evidence.md
Acceptance criteria are re-reviewed after implementation and reflect actual behavior
Specification: docs/issues/open/<number>-1488-fix-http-environment-drop-path/ISSUE.md (added by the spec-only PR).
Activity
docs(issues): add issue specification for torrust#2471
docs(issues): add torrust#2471 to the shutdown EPIC roadmap
docs(issues): refresh SI-22 specs with lessons from SI-17
docs(issues): require the drop path in SI-23 and SI-24
docs(issues): add issue specification for torrust#2471
docs(issues): add torrust#2471 to the shutdown EPIC roadmap
docs(issues): refresh SI-22 specs with lessons from SI-17
docs(issues): require the drop path in SI-23 and SI-24
docs(issues): record the torrust#2471 reproduction's symptom and hypo…
docs(issues): restore the torrust#2471 post-green design-review check…
docs(issues): refresh the SI-18 and SI-19 update timestamps
docs(issues): add issue specification for torrust#2471
17 remaining items
docs(issues): [torrust#2471] leave the acceptance criteria to the rev…
docs(issues): [torrust#1488] keep roadmap row 14 Planned until the to…
docs(issues): [torrust#2471] cite review findings by their review-fin…
docs(issues): [torrust#2471] mark V1's hypothesis as disproved
docs(issues): [torrust#2471] record that the REST and health-check le…
fix(axum-http-server): [#2471] stop the HTTP test environment when dr…
docs(issues): [#1488] mark #2471 done in the shutdown roadmap
Merge torrust#2544: fix(axum-http-server): [torrust#2471] stop the HT…
chore(issues): archive closed issue #2471 spec to docs/issues/closed
Merge #2551: chore(issues): archive closed issue #2471 spec to docs/i…
Merge #2553: docs(shutdown): [#2413] document event flows and draft t…
docs(issues): [#2410] refresh stale SI-22 spec text before #2414
Merge #2569: docs(issues): close the #2413 delivery gates and refresh…
Merge #2635: docs(issues): [#2449] refresh the SI-23 and SI-24 specs …