Skip to content

Coordinate response tasks and delivery during shutdown - #128

Merged
Stephen Belanger (Qard) merged 1 commit into
refactor/runtime-ownershipfrom
refactor/response-task-lifecycle
Oct 28, 2026
Merged

Stephen Belanger (Qard) merged 1 commit into
refactor/runtime-ownershipfrom
refactor/response-task-lifecycle

Conversation

@Qard

Copy link
Copy Markdown
Contributor

Shutdown previously drained ingestion while accepted HTTP requests and background login could continue running. Coordinate both domains under the first shutdown call’s deadline, close both admission paths immediately, and share the final shutdown outcome across concurrent callers.

  • Track at most 1,024 response tasks with atomic admission and completion registration. Runtime loss and timeout resolve their tokens, retire tracking, and cancel pending work, including tasks not yet polled. Dropping an observer still leaves accepted work running.
  • Reserve lifecycle control capacity independently of response admission. A write failure still waits for accepted HTTP work; a deadline cancels both domains. Individual HTTP operation errors remain on their tokens without a shutdown failure history. ShutdownReport.delivered continues to count trace writes.
  • Track background login and publish completion notifications outside internal locks so observer wakeups and unobserved result destruction can reenter scheduling safely. Reuse the bounded shared outcome implementation for span finalization and shutdown.

Stacked on #127. Public resource methods still use the existing async adapters; converting them to eager completion methods follows in the next layer.

Validation: 310 unit/integration tests and 9 doctests passed (existing ignored tests unchanged); strict all-target/all-feature Clippy, rustdoc, formatting, and diff checks passed. Regression coverage includes simultaneous HTTP/ingestion timeout, background login, concurrent shutdown, response saturation, runtime loss before first poll, admission races, reentrant publication, and explicit runtime progress obligations.

@Qard
Stephen Belanger (Qard) merged commit 3b254db into refactor/runtime-ownership Oct 28, 2026
2 checks passed
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