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(elixir-client): Fix monitoring registration race condition #2171

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

msfstef
Copy link
Contributor

@msfstef msfstef commented Dec 16, 2024

Fixes race condition where the monitoring process would start, initialise the request process, and the request would complete before the listener registered itself with the monitoring process.

This would normally trigger an error and a retry, so overall it's not a critical bug for production, but in our tests where our responses are mocked exactly once, if a response was missed the test would time out.

My approach was to "hold" the response in the monitor until at least one subscriber is present - I don't love it cause then for the monitor to shut down it needs to have something registered to it after initialization, but it felt like a decent fix with the assunmption that each monitor process will be accompanied with a registration.

Copy link
Contributor

@magnetised magnetised left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool. hope this is the last race condition!

@msfstef msfstef merged commit 1b8dce0 into main Dec 16, 2024
32 checks passed
@msfstef msfstef deleted the msfstef/fix-elixir-client-mock branch December 16, 2024 13:35
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.

2 participants