hackney_pool: regression test for the noproc race (#869)#870
Merged
Conversation
Adds a test that injects a process which is alive for is_process_alive/1 but exits when is_ready/1 calls it, asserting the pool survives and serves a fresh connection. Without the #869 fix this crashed the pool. Also tidies the try/catch landed in #869: trailing whitespace removed and a comment explaining the race.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #869 (fix by @kpy3).
Adds a regression test for the pool crash: it injects a process that is alive for is_process_alive/1 but exits the instant is_ready/1 calls it, reproducing the {noproc,{gen_statem,call,[_,is_ready,infinity]}} race. The test asserts the pool survives and serves a fresh connection. Verified it fails on the pre-#869 code and passes with the fix.
Also tidies the try/catch from #869: removes trailing whitespace and adds a comment explaining the race.