Skip to content
This repository has been archived by the owner on Mar 29, 2024. It is now read-only.

feat(watch): set hasleader metadata #82

Merged
merged 1 commit into from Nov 22, 2022
Merged

Conversation

Direktor799
Copy link
Contributor

According to comment of Watcher in etcd repo

In order to prevent a watch stream being stuck in a partitioned node, make sure to wrap context with "WithRequireLeader".

The WithRequireLeader function set the metadata hasleader to true, and etcdctl has done this, so maybe we should do the same?
Another way is to provide a function to set metadata of requests, but I believe set hasleader in watch is what etcd recommended since it's crucial to know if the current etcd endpoint is working properly or not.

@Direktor799
Copy link
Contributor Author

Direktor799 commented Nov 21, 2022

related to #79

@zarvd
Copy link
Owner

zarvd commented Nov 22, 2022

Thanks! LGTM

@zarvd zarvd enabled auto-merge (squash) November 22, 2022 03:45
@zarvd zarvd merged commit 91c1c47 into zarvd:master Nov 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants