-
Notifications
You must be signed in to change notification settings - Fork 671
added a validation to check whether lock exists in case of network pa… #230
base: master
Are you sure you want to change the base?
added a validation to check whether lock exists in case of network pa… #230
Conversation
IT seems that CI is failing on the make command. |
…re is no possibility to use same lock object to obtain lock for different paths
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 fix doesn't solve the problem you've described. CreateProtectedEphemeralSequential may return an empty path, while znode itself can be normally created by ZK server. To implement fix right, you need to match session identifiers for zknode objects and your connection if they are the same, and if so then you can assume that lock is acquired.
In addition to this you need to add tests for your new code and ensure that your code is properly formatted as it seems that it's not following golang styleguides.
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.
As @ydidukh this might work. Have you tried to test it manually?
Suggestion. Is there a possibility to listen for the State of the client? if yes, there might be a way to make new connection when the state is back to connected and assign session identifiers existing locks (or recreate them with new identifiers).
Hi Samuel,
|
This addresses #229