-
-
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
close()
closes immediately; Add new closeGracefully()
#383
Conversation
close()
closes immediately; Add new gracefulClose()close()
closes immediately; Add new gracefulClose()
close()
closes immediately; Add new gracefulClose()
close()
closes immediately; Add new closeGracefully()
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #383 +/- ##
==========================================
+ Coverage 46.07% 47.53% +1.46%
==========================================
Files 109 109
Lines 8728 8764 +36
==========================================
+ Hits 4021 4166 +145
+ Misses 4707 4598 -109
|
@available(*, deprecated, renamed: "clientClosesConnection") | ||
public static let connectionQuiescing = Self.clientClosesConnection | ||
|
||
@available(*, deprecated, message: "Use the more specific `serverClosedConnection` or `clientClosedConnection` instead") |
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.
🚨 @gwynne
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.
I concur that the change in behavior is worthwhile.
Fixes #370.
This PR changes the behavior of
close()
.close()
now closes a connection immediately. We introduce acloseGracefully()
that now has the same behavior as close before. Since we never documented the old close behavior and it is unfortunate that close does depend on the remote server to fulfill all queries, we consider it okay to change the behavior in this way. The current behavior is harmful since there is currently no way to force close a connection. Users might be in a position to force close a connection if a server stops responding.Alternative: close keeps graceful close behavior and we add a closeForcefully method instead