fix(cdc-listener): clear outstandingProbeToken on timeout to unwedge probe#1404
Open
jakebromberg wants to merge 1 commit into
Open
fix(cdc-listener): clear outstandingProbeToken on timeout to unwedge probe#1404jakebromberg wants to merge 1 commit into
jakebromberg wants to merge 1 commit into
Conversation
…probe (#1116) The echo-timeout branch in `runProbeTick` dispatched `connected=false` but left `outstandingProbeToken` set. The early-return at the top of the next tick then short-circuits every subsequent interval — probing is permanently dead until process restart, even after postgres-js auto-reconnect re-LISTENs and the `onlisten` hook re-dispatches true. Clear the token + timestamp before dispatching false so the next interval re-arms with a fresh NOTIFY. Stop path already resets at lines 215-216, so no change needed there. Test coverage: - New regression test: wedge -> timeout -> simulated reconnect -> a fresh NOTIFY goes out -> second wedge also dispatches false. - Restructured the existing "echo arrives" test to flip false via a one-shot NOTIFY rejection rather than the timeout path (late-arriving echoes after timeout are intentionally a no-op now; `onlisten` on auto-reconnect is the recovery signal, per the issue's note).
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.
Closes #1116
Summary
runProbeTick's echo-timeout branch dispatchedconnected=falsebut leftoutstandingProbeTokenset, so every subsequent interval took the early-return and no new probe ever fired. The liveness signal was dark until process restart — even after postgres-js auto-reconnect re-LISTENed.outstandingProbeToken+outstandingProbeAtbefore dispatching false on the timeout path, so the next interval re-arms with a fresh NOTIFY. Stop path already resets at lines 215-216; no change needed there.onlistenon auto-reconnect — which already dispatchesconnected=true— is the proper recovery signal.Test plan