Ensure connection is usable after COPY stream is complete#1016
Open
valeneiko wants to merge 3 commits intoporsager:masterfrom
Open
Ensure connection is usable after COPY stream is complete#1016valeneiko wants to merge 3 commits intoporsager:masterfrom
valeneiko wants to merge 3 commits intoporsager:masterfrom
Conversation
Owner
|
Nice work! Looks good! You don't need the changes in the generated folders (cf, cjs, deno) so could you discard those changes? Also perhaps rebase on your latest PR that fixed CI |
35e31b4 to
77c820e
Compare
This comment was marked as resolved.
This comment was marked as resolved.
588680a to
2797ff4
Compare
Contributor
Author
|
@porsager PR is updated and CI is green. |
4fd011e to
a92f470
Compare
jarohen
added a commit
to jarohen/xtdb
that referenced
this pull request
Aug 14, 2025
4a0fe34 to
3a43815
Compare
|
Is there anything holding back this fix? We are hit by this very often as well. 🙏 |
|
@porsager, could you kindly provide an update on this PR? Is it still relevant or has the issue been fixed elsewhere? We have a number of users who are hit by this issue. |
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
Encountered this issue in a live environment.
Sometimes random queries were hanging indefinitely after using a
COPYstream.This PR likely fixes:
Cause
This was caused by receiving
CopyDataandCopyDonemessages within the same chunk.If
CopyDatatriggers high water mark, handler pauses the socket, but still continues to process remaining messages, that were already received.If
CopyDoneis handled before stream managed to process buffered messages, the connection becomes unusable - the socket is paused. Any query using that connection will hang indefinitely (with response data in the socket read buffer).Fix
Make sure socket is flowing after
COPYstream is done.The test is a little complicated, but I couldn't find a simpler way to reliably reproduce the issue (now without the fix the test will timeout every time).