-
Notifications
You must be signed in to change notification settings - Fork 12
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
Fix bugs on Watcher and connect()/close(). #19
Conversation
Fix Connect and Watch iterator
Upgrade to proto 4
Hey @jpark-prestolabs , many thanks for the changes and continous updates. Unfortunately, I didn't have enough time to review the MR. I'll try to look at it over the weekend. |
@jpark-prestolabs if you don't mind I'll split the MR into several chunks and cherry-pick by one. |
Thank you for your review. It's good to me. |
NOTE: It could be called while other operation is being executed. | ||
At that time, the executing operation will be broken. | ||
""" | ||
for _ in range(MAX_COUNT_TO_WAIT_CONNECT_CHECK): |
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.
If we already have _connection_check_timeout
what is the reasoning behind MAX_COUNT_TO_WAIT_CONNECT_CHECK
and multiple tries?
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.
It's long time ago for me to update it. Sorry I cannot remember the exact reason.
Probably _connection_check_timeout
could be enough.
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.
Now I remember that it is for etcd cluster.
MAX_COUNT_TO_WAIT_CONNECT_CHECK
is used for making a connection.
One host name is used for multiple etcd instances in a cluster. So I'd like to make multiple trial.
But here, it could not be required.
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've created an issue #20 to natively support multiple endpoints.
I will mostly retain the old formatting as it is highly depends on tooling. The only way to fix it consistently is to intergrate black into the pipeline. |
@@ -203,6 +271,20 @@ async def __aenter__(self): | |||
async def __aexit__(self, *args): | |||
await self.close() | |||
|
|||
@_handle_errors | |||
@_ensure_connected | |||
async def reset_auth_token(self) -> None: |
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.
This probably should be refactored into private _auth
and public auth
and reused in connect
.
@jpark-prestolabs I cherry-picked everything except |
This fix includes,