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

[bug]: ResourceWatcher race condition on StopAsync() and OnError() #676

Open
PSanetra opened this issue Dec 4, 2023 · 0 comments
Open
Labels
bug Something isn't working

Comments

@PSanetra
Copy link

PSanetra commented Dec 4, 2023

Describe the bug

It seems like there is a race condition between ResourceWatcher.OnError() and ResourceWatcher.StopAsync().

To reproduce

  1. ResourceWatcher.StartAsync()
  2. Wait for ResourceWatcher to be connected
  3. Create network issue (e.g. reset_peer with toxiproxy)
  4. ResourceWatcher.StopAsync()

StopAsync() will put the ResourceWatcher into a stop state, but OnError() will try to restart the ResourceWatcher until it succeeds and the watcher will actually never stop.

Expected behavior

Calling StopAsync should guarantee that the ResourceWatcher stops and will never emit any new event until StartAsync() is called again. This is a critical requirement for the LeaderAwareResourceWatcher.

Screenshots

No response

Additional Context

Version: 8.0.0-pre.29

@PSanetra PSanetra added the bug Something isn't working label Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant