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

Consul lock does not really work with timeout #8309

Closed
5antelope opened this issue Jun 11, 2021 · 0 comments
Closed

Consul lock does not really work with timeout #8309

5antelope opened this issue Jun 11, 2021 · 0 comments

Comments

@5antelope
Copy link
Member

When filing a bug, please include the following headings if
possible. Any example text in this template can be deleted.

Overview of the Issue

Vitess assumes the process gets the lock if the error is nil https://github.com/vitessio/vitess/blob/main/go/vt/topo/locks.go

However, consul will return nil error when the context timeout’d before the process get the lock: https://github.com/hashicorp/consul/blob/master/api/lock.go#L185 - which means anyone will get the lock after the context timeout.

This means after the context timeout, everyone that is waiting for the lock will get one

Reproduction Steps

Process A grabbed a lock and then have another process B grab the lock, while A is holding the lock, B will also get one after the context timeout

Operating system and Environment details

Does not matter

Log Fragments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants