Repository navigation
storage: an agent-db not_found notice ends the connection for good #8626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 False refusal for other-socket writes
When another socket still holds an unanswered write,
gonemakes that write failNotFoundtoo. After closure, wait returns the connection-wide fatal error for its empty channel. The notice does not establish that other socket's write outcome, so a committed write can be reported as unapplied.Learn more
A connection can retain an old socket with unanswered requests while using a replacement socket; Supervisor::run starts a separate reader for that old socket. A deletion notice guarantees that unanswered requests on its own socket applied nothing, but says nothing about requests on the other socket. Inner::close clears every pending request and cancels every reader. Requests on other generations receive no queued error here, so Conn::wait substitutes the connection-wide fatal error when their channels empty. The write-error conversion treats that NOT_FOUND as proof that nothing applied, losing the distinction between refusal and unknown outcome.
Example: Socket A commits an INSERT but has not delivered its answer. A different request receives wrong_shard_server, retiring A and opening socket B. B receives a deletion notice before A delivers its INSERT answer. Closing the connection makes the INSERT return NotFound, although only B's unanswered requests were proven unapplied.
Recommended fix: Before closing, queue a Disconnected terminal result for pending requests bound to other socket generations, while preserving already queued answers. Keep NOT_FOUND for the notifying generation and later unsent calls. Add a two-socket regression covering a retiring write whose answer remains outstanding when the replacement socket receives the deletion notice.
Was this helpful? React with 👍 or 👎 to provide feedback.