Repository navigation
app/: the live listener survives its first probe (system clock, not Laravel's) - #152
Merged
Merged
Conversation
…(which panics outside the app and killed the listener)
ndbroadbent
force-pushed
the
app-live-listener-clock
branch
from
December 3, 2026 22:37
6396d09 to
2ed9d7d
Compare
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.
After #149 deployed, /status read
live_listener: staleand streams got their snapshot but no live changes. talira infra found the panic in the web pod's log at 22:20:35 UTC:thread 'tokio-rt-worker' panicked at app/src/live.rs:157:37: laravel::now() can only be used inside the application…. The listener's supervisor is a plaintokio::spawntask, outside the application, and it calledlaravel::now()when its first probe came back, so it died there, leaving its LISTEN connection open and unread (so stale, not can't-connect). It isn't a pooler: DATABASE_URL goes straight to CloudNativePG's -rw service.Fix: both places the probe's bookkeeping read Laravel's clock (
healthy()and the store after a successful probe) now use the file's ownunix_seconds()(system clock), which the hub already used for its start time, so both sides of the comparison share one clock. The stream bodies were already safe: they read the database insidecontext.scope(...).Test:
live::tests::probe_health_needs_no_application_context, a plain unit test with no application, exerciseshealthy()and the probe store. Before the fix,healthy()panics there. The integration tests didn't catch it because they run with the application's context around them.Checks (build pool): fmt, clippy -D warnings, the unit test,
live_streams(12) andlive_limits(1) pass.After it deploys: /status should read
live_listener: okwithin a minute of a stream opening; then talira infra adds the Gatus check.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.