Repository navigation
fix(mongodb): Don't return empty status, and return partial results - #793
Merged
codyprime merged 2 commits intoOct 22, 2026
Merged
Conversation
rkingatcensys
approved these changes
Oct 20, 2026
The buildInfo write error path returned an empty ScanStatus and a nil result. An empty status is not a member of the ScanStatus enum, so library users that map statuses (e.g. to protobuf) fail to handle the result at all, and the isMaster/listDatabases results already gathered are discarded. Match the buildInfo read error path just below it: derive the status from the error with TryGetScanStatus and return the partial result. This also restores the behavior from before the write error was checked, when a failed write surfaced through the subsequent read.
A buildInfo reply that is not valid BSON discarded the whole result, including the isMaster and listDatabases responses already gathered. Return the partial result with SCAN_PROTOCOL_ERROR instead, clearing any half-unmarshaled BuildInfo, matching the truncated-reply path just above it.
codyprime
force-pushed
the
jcody/mongodb-buildinfo-write-status
branch
from
October 22, 2026 16:05
4eb939d to
3955192
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.
The buildInfo write error path returned an empty ScanStatus and a nil result. An empty status is not a member of the ScanStatus enum, so library users that map statuses (e.g. to protobuf) fail to handle the result at all, and the isMaster/listDatabases results already gathered are discarded.
Match the buildInfo read error path just below it: derive the status from the error with TryGetScanStatus and return the partial result. This also restores the behavior from before the write error was checked, when a failed write surfaced through the subsequent read.
How to Test
I've only seen this on transient network failures, so a natural reproducer is not available
Notes & Caveats
Issue Tracking