-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
[Fix] Query Hangs if Connection is Closed #487
Merged
fabianfett
merged 25 commits into
vapor:main
from
MahdiBM:mmbm-conn-close-mid-query-hangs
Jun 24, 2024
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
9206b25
Add a test to reproduce the problem
MahdiBM 5ff285b
fail query promise when channel write fails
MahdiBM 3e49ef1
make sure the test succeeds
MahdiBM c2192a7
do the same for prepared statements query
MahdiBM a288cc2
minor refinements
MahdiBM d98944a
more clear query
MahdiBM 00c11b6
more writePromise s catching channel failures
MahdiBM 2ed7946
one more place
MahdiBM e92b2f0
move query into the loop
MahdiBM e127327
use a private function to simplify cascading channel failures
MahdiBM 9ff54d9
better `write` function accepting `HandlerTask`, not a generic
MahdiBM fe8f9fe
better test, move the test to `PostgresConnectionTests`
MahdiBM 2a43b88
move/rename test
MahdiBM e41c922
[build fix] forgot to change the passed parameter
MahdiBM 607f26e
add a test for listen
MahdiBM f00099b
add another test for mid-way listens + fix the code
MahdiBM c43e781
spaces
MahdiBM 8fe12f5
fix for resuming continuation multiple times
MahdiBM 843d6a0
use backward-compatible `Task.sleep()`
MahdiBM 3e56e49
add a listen test that does hang
MahdiBM 552c913
aesthetics
MahdiBM c97e127
fix the hanging test: was a testing issue, not code
MahdiBM 138aea3
add test for prepareStatement
MahdiBM 22db6e4
add execute function tests
MahdiBM ceaa688
minor
MahdiBM 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -359,5 +359,4 @@ final class IntegrationTests: XCTestCase { | |
XCTAssertEqual(obj?.bar, 2) | ||
} | ||
} | ||
|
||
} |
This file contains 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.
Using
.close()
instead of.closeGracefully()
here because.closeGracefully()
will wait it out till infinity and beyond, apparently because it's "graceful" and the listener is still listening.