-
Notifications
You must be signed in to change notification settings - Fork 117
[471] - Close underlying HTTP Client on closing Connection
#674
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
Open
Varun0157
wants to merge
27
commits into
databricks:main
Choose a base branch
from
Varun0157:close-conn
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+63
−13
Open
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
4437a2a
Refactor codebase to use a unified http client
vikrantpuppala 30c04a6
Some more fixes and aligned tests
vikrantpuppala 4294600
Fix all tests
vikrantpuppala 3155211
fmt
vikrantpuppala 1143838
preliminary connection closure func
Varun0157 68cc822
unit test for backend closure
Varun0157 ef1d9fd
remove redundant comment
Varun0157 4bb2e4b
assert SEA http client closure in unit tests
Varun0157 734dd06
correct docstrng
Varun0157 d00e3c8
fix e2e
vikrantpuppala 000d3a3
fix unit
vikrantpuppala cba3da7
more fixes
vikrantpuppala 2a1f719
more fixes
vikrantpuppala 1dd40a1
review comments
vikrantpuppala 3847aca
fix warnings
vikrantpuppala d9a4797
fix check-types
vikrantpuppala ba2a3a9
remove separate http client for telemetry
vikrantpuppala d1f045e
more clean up
vikrantpuppala ea3b0b0
Merge remote-tracking branch 'target/http-client-refactor-2' into clo…
Varun0157 4e66230
remove excess release_connection call
Varun0157 bf0a2f6
Merge remote-tracking branch 'target/main' into close-conn
Varun0157 67020f1
formatting (black) - fix some closures
Varun0157 496d7f7
Revert "formatting (black) - fix some closures"
Varun0157 84ec33a
add more http_client closures
Varun0157 76ce5ce
remove excess close call
Varun0157 4452725
wait for _flush before closing HTTP client
Varun0157 d90ac80
make close() async
Varun0157 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 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
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
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
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
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
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
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
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.
why is a session and http client closed together? I feel it is easier to imagine the backend module as a function module for interacting with SQL EXEC. So, with that perspective, there should be minimal state in this and the backend should receive resources by higher level classes and those higher level classes should take care of closing the resources (for example, the connection/cursor should pass a http client to this and close the http client. Same goes for session: cursor maintains the session obtained functionally through this backend and should take care of closing the session). Please let me know if this doesn't look okay.
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 agree with the philosophy overall, but I think passing the HTTP client into the backend from a higher-level object is likely infeasible right now since both backends have distinct, custom HTTP clients that expose different methods and are processed differently. Until we unify them, it makes sense to make the backend responsible for it's own HTTP Client instantiation, as a result of which it should be responsible for closing it as well.
Both HTTP Clients do have largely the same functionality, so unifying them (for the most part) could be a separate PR, at which point we can pass in the HTTP client from the
Session
class.Let me know if I should do it in this PR instead.
Note that the pattern of instantiating the required HTTP client in the constructor of the concrete backend is common across Thrift and SEA.