CXXCBC-576: Ensure all HTTP sessions are stopped when closing the core cluster#648
Merged
avsej merged 1 commit intocouchbase:mainfrom Aug 27, 2024
Merged
Conversation
thejcfactor
reviewed
Aug 26, 2024
Contributor
thejcfactor
left a comment
There was a problem hiding this comment.
I intend to play w/ this change a bit more in the Python Columnar client, but I think all looks well. I just had a couple of comments.
a7aa79a to
19267fd
Compare
19267fd to
b250f97
Compare
thejcfactor
approved these changes
Aug 27, 2024
Contributor
thejcfactor
left a comment
There was a problem hiding this comment.
LGTM 👍
Did further testing w/ the Python Columnar client. Thanks for making these changes!
avsej
approved these changes
Aug 27, 2024
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.
Motivation
When
cluster.close()is called, all in-progress HTTP operations should be cancelled.Changes
pending_sessions_in the HTTP session manager to ensure that it has a reference to sessions created by it at all stages of their lifetime. Pending operations are the sessions that are currently connecting (i.e. after they have been removed fromidle_sessions_or created and before being added tobusy_sessions_)couchbase::core::columnar::client_errcerror codes to represent errors that are not the result of a client-server interaction. These are the errors that should be exposed in a platform-idiomatic way in the wrappers, not asColumnarErrors - one example is cancellation which happens on the client-side.pending_query_operationreplace the use ofcolumnar::errc::genericfor cancellations with the newcolumnar::client_errc::canceledhttp_session_manager.close()is called, force all the sessions owned by the manager to stop, not just discarding the pointers.retry_info_for apending_query_operationwhere the session wrapped by it isnullptr(e.g. in the case of a dispatch timeout)execute_queryhas returned & for closing the cluster while rows are being iteratedResults
All tests pass