Repository navigation
feat(rest-api): [#2309] migrate token lifecycle - #2316
Merged
josecelano merged 2 commits intoSep 23, 2026
Merged
josecelano merged 2 commits into
josecelano merged 2 commits into
Conversation
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
Review effort: Lite
Findings: 5
Open (5)
This test will block indefinitely if either the server task or the drain controller never completes… · New The 1-second deadline can be flaky on slow or contended CI runners (especially with async… · New The error mapping conflates two different failure modes under the same “tracker API runtime task… · New These test awaits are unbounded and can hang the test suite indefinitely if a regression prevents… · New These test awaits are unbounded and can hang the test suite indefinitely if a regression prevents… · New
What changed in this PR
This PR migrates the REST API lifecycle to a token-aware, JobManager-supervised model that explicitly retains and joins both the REST server task and its drain-controller, while preserving the legacy start/stop behavior.
Changes:
- Add a token-aware
ApiServer::start_with_cancellationpath that returns both runtime and drain-controller handles, plus registration rollback. - Update bootstrap supervision to await server + drain-controller on cancellation, independent completion, and runtime failure.
- Add deterministic tests and issue-local verification evidence (including direct SIGTERM + listener rebind).
| File | Description |
|---|---|
| src/bootstrap/jobs/tracker_apis.rs | Switches REST API job to token-aware start + adds supervisor that joins runtime and drain-controller; adds unit tests for completion/failure semantics. |
| src/app.rs | Propagates JobManager cancellation via child token; adds integration test asserting http_api is cancelled via JobManager. |
| packages/axum-rest-api-server/src/server.rs | Introduces start_with_cancellation, CancellationRunning, and typed runtime error; adds tests for drain and listener release on registration failure. |
| packages/axum-rest-api-server/Cargo.toml | Adds tokio-util dependency to support CancellationToken. |
| docs/issues/open/2309-1488-si-12-migrate-rest-api-token-lifecycle/*.md | Records deterministic + manual verification evidence and retrospective notes for #2309. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Copilot stopped reviewing on behalf of
josecelano due to an error
September 23, 2026 11:24
josecelano
force-pushed
the
2309-1488-si-12-migrate-rest-api-token-lifecycle
branch
from
September 23, 2026 11:51
1d9575c to
4a73235
Compare
Member
Author
|
ACK 4a73235 |
This was referenced Sep 23, 2026
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Validation
Closes #2309