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

fix: prevent hanging if stop called from multiple threads #554

Merged

Conversation

robertcoltheart
Copy link
Contributor

@robertcoltheart robertcoltheart commented Apr 10, 2024

Description

There are certain cases when StopAsync is called multiple times on different threads, which presents itself as the StopAsync call hanging indefinitely. This change adds thread protection to ensure that StopAsync is only called once.

An example of when this occurs is here when using WebApplicationFactory<> for testing.

How Has This Been Tested?

I've run this in a local unit test scenario against a real Kafka instance to ensure that the teardown is clean and handles multiple concurrent calls to StopAsync.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have added tests to cover my changes
  • I have made corresponding changes to the documentation

Disclaimer

By sending us your contributions, you are agreeing that your contribution is made subject to the terms of our Contributor Ownership Statement

@ruiqbarbosa ruiqbarbosa merged commit 16f7851 into Farfetch:master Apr 15, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

6 participants