Skip to content
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

When reusing an existing watch, there's a race condition with incoming watch events #52

Merged
merged 1 commit into from
Jun 27, 2022

Conversation

balena
Copy link
Contributor

@balena balena commented Jun 23, 2022

The error looks like:

** (MatchError) no match of right hand side value: {:ok, %{cancel_reason: "", canceled: false, compact_revision: 0, created: false, events: [%{kv: %{create_revision: 38458213, key: "/foo", lease: 4658271320502330774, mod_revision: 48536024, value: "bar", version: 583}, type: :PUT}], fragment: false, header: %{cluster_id: 16182920199522267672, member_id: 6198688855164797093, raft_term: 13, revision: 48536024}, watch_id: 0}, ""}
    (eetcd 0.3.5) /path/to/eetcd/src/eetcd_watch.erl:225: :eetcd_watch.watch_reuse_/3

It seems to happen because at the time the second watch request is sent, the server already sent a change event.

This PR not necessarily "fix" the problem, as it seems the etcd server actually ends up creating the watch, and the client process might end up retrying by creating the same watch a second time. But at least opens space to understand what's wrong with it.

@zhongwencool zhongwencool merged commit bca0c9b into zhongwencool:master Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants