Implementation refactor for Client-based interface#286
Merged
fantix merged 26 commits intogeldata:masterfrom Feb 2, 2022
Merged
Implementation refactor for Client-based interface#286fantix merged 26 commits intogeldata:masterfrom
fantix merged 26 commits intogeldata:masterfrom
Conversation
This fixes the case when EdgeDB client is global and used in an ``asyncio.run`` call, the client uses a wrong loop.
Before this fix, the client allows multiple concurrent first connections. This wasn't an issue because the _working_addr is always the same among the concurrent first connections. However, it was not clear which address shall win the race and be used for upcoming connections when multiple addresses are used in the future. After this fix, all concurrent first connection attempts will be serialized, the address from the first successful connection will be used for following connections. Concurrency will be resumed as soon as the address is found, including the previously-serialized pending "first" connections.
Switch to using a single ``_connect_args`` dict to store all connect arguments, which is also consistent with ``con_utils.parse_connect_arguments()``.
0efc2e4 to
93516b9
Compare
Also added blocking pool (single-connection only), and fixed all tests to use client instead of connection.
88fe5ac to
d5133d1
Compare
Also close blocking client socket on disconnect, and fix tests
Also extracted most duplicate code, and dropped outdated code
In this case, concurrent close() and connect() are racing. If connect() wins, close() was releasing the connection by mistake.
elprans
reviewed
Jan 19, 2022
Member
elprans
left a comment
There was a problem hiding this comment.
Impressive work, Fantix! A net reduction of ~700 lines in the implementation despite the addition of a thread-safe concurrent blocking pool. I especially like the cleanup in the transaction implementation.
1st1
reviewed
Feb 1, 2022
1st1
approved these changes
Feb 1, 2022
Member
1st1
left a comment
There was a problem hiding this comment.
Epic work, Fantix. I think this is ready to land.
Merged
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.
Review note: there is one merge commit "Partially revert ..." in this branch to reserve git history; use this link to see the merged diff.
edgedb.connect()and replace with a single-connectionClient_iter_coroutine()on top level