-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(elixir-client): Fix monitoring registration race condition (#2171)
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.
- Loading branch information
Showing
4 changed files
with
52 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@core/elixir-client": patch | ||
--- | ||
|
||
Fix race condition where response comes before listener has monitored itself. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters