Repository navigation
The queue drain has a caller now, and it is the host's - #156
Merged
Merged
Conversation
known-issues.md said the messages buffered at SIGTERM are still lost. That was true when it was written and stopped being true with go-admin-team/go-admin#918, which registers a BeforeExit callback that shuts down the adapter go-admin installed. A reader following the old text would either rebuild something that already exists, or route around a data-loss risk that is no longer there. contract.md section 12 said a deployment that cannot lose audit rows has to register the shutdown itself. Also no longer true of go-admin, and the sentence gave a host writing its own wiring no idea what to write. It now says what to do and names the trap: shut down the adapter the host installed, not whatever GetQueueAdapter returns - that accessor never returns nil, and with nothing configured it wraps this module's own fallback queue, so going through it closes a queue the host neither built nor started. What has not changed is where the call comes from. This module provides the drain and cannot notice a host that never asks for it; a host that registers nothing still loses its backlog, silently. Both files say so.
There was a problem hiding this comment.
🟢 Approval recommended
Documentation-only changes appear internally consistent with core’s runtime behavior (notably GetQueueAdapter/fallback semantics) and align with the PR description’s intent.
Pull request overview
Updates documentation to reflect that queue draining on shutdown is provided by go-admin-core but must be invoked by the host, and that go-admin now registers the appropriate BeforeExit callback (per go-admin#918). This clarifies the remaining risk for other hosts and calls out the subtle trap of shutting down the wrong queue instance.
Changes:
- Update
known-issues.mdto explain that go-admin now calls the drain on exit, while other hosts must still wire it themselves. - Update contract section 12 to state the host’s responsibility for registering the shutdown callback, including guidance to shut down the installed adapter (not the
GetQueueAdapterwrapper/fallback).
File summaries
| File | Description |
|---|---|
| docs/known-issues.md | Corrects the shutdown/drain “caller” status and clarifies remaining host responsibility. |
| docs/contract.md | Updates lifecycle contract text with accurate host wiring guidance and the GetQueueAdapter shutdown trap. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Two statements in the documentation stopped being true when go-admin#918 landed, and both are the kind that sends a reader somewhere unhelpful.
known-issues.mdentry 2 said the messages buffered at SIGTERM are still lost. v2.7.0 fixed the drain itself, and that entry correctly recorded that nothing was calling it — go-admin shut down only the previous adapter during a reload, and abandoned the installed one at exit. go-admin now registers aBeforeExitcallback for it. A reader following the old text would either build something that already exists, or plan around a data-loss risk that is no longer there.contract.mdsection 12 said a deployment that cannot lose audit rows has to register that shutdown itself. Also no longer true of go-admin, and the sentence left a host writing its own wiring with nothing to go on.The replacement says what to do, and names the trap that made the go-admin implementation harder than it looks: shut down the adapter the host installed, not whatever
GetQueueAdapterreturns. That accessor never returns nil — with no queue section configured the runtime wraps its own fallback — so going through it closes a queue the host neither built nor started, while looking like it worked.What has not changed is where the call comes from. This module provides the drain and has no point at which it could notice a host that never asks for it. A host that registers nothing still loses its backlog, silently, and both files now say that rather than implying the problem is gone.
Documentation only.