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.
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
Multiple endpoints #55
base: master
Are you sure you want to change the base?
Multiple endpoints #55
Changes from 21 commits
dc2407e
4b1de04
e3defa3
c744c1a
7a61e92
7b33a71
41492ff
cad609a
4406119
ea4814f
a6c50b7
cebbedb
f4e46dd
2e38ccb
1951e1c
a66edf9
6998a42
78d0a65
16be75c
aead4ea
95c7d24
ba4ea4f
339f4aa
ae94b43
7a07e22
ec49b1a
681d39c
0151244
d47f9ed
709f74e
3aa610e
8206a66
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
maybe a lock is better than copy
if we have 3 endpoints of which the initial 2 are invalid:
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.
There are two problems to consider:
.endpoints
)A lock could work, but to prevent
2
it should lock the wholewhile retries > 0
loop and so prevent concurrent calls.It should work correctly if when the while loop operating on the copy exits correctly, I add a block:
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.
no need to lock the whole
while retries > 0
in fact, atomicity seems not so important here
or, just lock
self.endpoints = xxxxx
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.
only retry when connection fails
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.
just catch these errors
aiohttp.ClientError
requests.RequestException
urllib3.exceptions.HTTPError
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.
with
at_least_one_of
I can't create default client
client=etcd3.Client()
the old wayThere 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.
You're right, I'm gonna remove the decorators
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.
removed in ae94b43
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 class contains only host and port but made creating a client less friendly
any further design on this?
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.
better put this into
etcd3/__init__.py