allow for overflow worker start failure#124
Open
juhlig wants to merge 1 commit intodevinus:masterfrom
Open
Conversation
Fixes the issue that failure to start an overflow worker in response to a checkout crashes a pool. Instead, this now raises an exit exception in the client.
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.
As described in #122, if an overflow worker was unable to start (which may always happen owing to circumstances), the
poolboygen_serverwould crash, because it invariably expects{ok, Pid}to be returned fromsupervisor:start_child/2in thenew_worker/1function. That is even though the spec for thepoolboy_worker:start_link/1callback function explicitly allows{error, term()}to be returned.This PR changes this in that it really allows error tuples to be returned from the worker start functions. If an overflow worker fails to start in response to a
checkoutortransactionrequest, anexitexception will be raised in the client instead. Failure to start a residual worker on pool start, or restart of an exited residual worker, will still cause a crash of the pool as before. I think that is what is to be expected, and it can be provided for when needed with the other PR (#123) that I recently submitted.