-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
Continue to make forward progress when cancelled #261
Conversation
Codecov Report
@@ Coverage Diff @@
## main #261 +/- ##
==========================================
+ Coverage 43.85% 44.57% +0.72%
==========================================
Files 115 115
Lines 9513 9639 +126
==========================================
+ Hits 4172 4297 +125
- Misses 5341 5342 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Drain connection, if stream was cancelled
434c00e
to
dfb7686
Compare
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.
Two utterly pointless grammar nits just to annoy you 🙂, plus one minor functional nit, marking as changes requested in case there was an actual logic error there.
Sources/PostgresNIO/New/Connection State Machine/ConnectionStateMachine.swift
Outdated
Show resolved
Hide resolved
Sources/PostgresNIO/New/Connection State Machine/ExtendedQueryStateMachine.swift
Outdated
Show resolved
Hide resolved
Sources/PostgresNIO/New/Connection State Machine/ExtendedQueryStateMachine.swift
Show resolved
Hide resolved
Co-authored-by: Gwynne Raskind <gwynne@darkrainfall.org>
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.
My bad on the misread, approved!
Motivation
With the async/await interface we introduced the option to ignore a rowStream (by dropping the
AsyncSequence
orAsyncIterator
). In those cases we must fail the stream and drain the connection ASAP. Otherwise we will lock up the connection.Changes
Result
Connection is reusable, even if previous queries were cancelled.
Note:
Needs more unit tests