fix(coverage): retry data-socket connect to survive a briefly-unavailable receiver#205
Open
slayerjain wants to merge 1 commit into
Open
fix(coverage): retry data-socket connect to survive a briefly-unavailable receiver#205slayerjain wants to merge 1 commit into
slayerjain wants to merge 1 commit into
Conversation
…vailable receiver
The coverage reporter did a single net.Dial to keploy's unix data socket; under
CPU starvation keploy's accept is momentarily unavailable (ENOENT/ECONNREFUSED),
so that test's coverage report was dropped permanently ('could not connect to
keploy data socket'), failing the lane's coverage-completeness check.
Wrap the connect in a bounded retry (capped exponential backoff, transient errors
only, 5s budget under keploy's 10s ACK deadline). Retries only the idempotent
connect -- never re-derives coverage data, so a genuinely-down socket still errors.
Signed-off-by: slayerjain <shubhamkjain@outlook.com>
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.
Problem
The
go-dedupcoverage-sync CI lane intermittently fails withcould not connect to keploy data socket.sendToSocketdid a singlenet.Dialto keploy's unix data socket; under CPU starvation keploy's receiver accept is momentarily unavailable (the socket file is re-created each run and the single accept loop can be briefly starved →ENOENT/ECONNREFUSED). A one-shot dial drops that test's coverage report permanently, and the lane then fails its coverage-completeness check.Fix
Wrap the connect in
dialDataSocketWithRetry: capped exponential backoff (25ms→400ms), retries only transient transport errors (ECONNREFUSED/ENOENT/deadline), bounded by a 5s budget that stays under keploy's 10s ACK read deadline (the END handler writes its ACK only aftersendToSocketreturns).It retries only the idempotent connect — never re-derives or fabricates coverage data — so a genuinely-down socket still errors loudly and a real miss is never masked.
Tests
keploy/coverage_dial_test.go(auth-free):...DeliversWhenListenerAppearsLate— the listener appears after a transient absent window; the retry connects (a single dial would have dropped the report)....FailsWithinBudgetWhenNoListener— a permanently-down socket still errors, within the bounded budget (no hang, no mask).Builds on all platforms (
syscall.ECONNREFUSED/ENOENTare defined cross-platform); golangci-lint clean.