Repository navigation
fix(code-intel): order transport failure publication - #161
Merged
Merged
Conversation
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
Root cause
transport.setFailuremarked the transport closed, but then delivered errors to pending request channels before closingtransport.done. A released request could resume in that interval.queryDiagnosticsusesdoneto distinguish a terminal transport failure from an ordinary pull-diagnostics RPC error, so the process-exit error could be misclassified and converted into a successful push fallback.The test helper deliberately exits during
textDocument/diagnostic. Under the race detector the affected request occasionally returnednil, leaving the crash masked. The same unchanged code alternated between pass and failure on the #159 head and its merge commit.This change closes
donebefore publishing pending request errors. Every released waiter therefore observes the terminal state. The new unbuffered-channel test makes that ordering contract deterministic and fails against the previous implementation.This is a pre-existing Code Intel lifecycle race introduced with #119. It is unrelated to the CSS-only changes in #158 and to the Command Runtime changes in #159.
Validation
go test -race -count=100 -timeout 10m ./internal/codeintel -run '^TestDiagnosticsDoesNotMaskTransportCrashAsPushFallback$'go test -race -count=1 -timeout 5m ./internal/codeintelgo test -count=1 -timeout 5m ./internal/codeintelgo vet ./internal/codeintelgit diff --checkRepairs the failure observed on
main@b42eccdin CI run 32749900859.