-
Notifications
You must be signed in to change notification settings - Fork 84
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
Of/kill stale started members #31
Of/kill stale started members #31
Conversation
StartingMembers = remove_stale_starting_members(Pool, StartingMembers0, | ||
StartTimeout), | ||
case lists:keymember(Ref, 1, StartingMembers) of | ||
#pool{starting_members = StartingMembers}= remove_stale_starting_members(Pool, StartingMembers0, StartTimeout), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at this I bet there's a cleanup to not have to pass StartingMembers since it is inside the Pool. But worth saving that for later :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want to capture the resulting pool so we can return it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, we should capture it so we can return it. In this case, the only difference between the pool returned by remove_stale_starting_members and the pool returned in the function is the field starting_members which is getting set correctly. However, that is not clear looking at the code.
Nice cleanups. Please squash to a single commit and I'll get this merged asap. |
On second, thought, please squash and merge it yourself :) You should now have access. |
Pooler/_starter previously had a bug where if a started process took longer than the start_member_timeout but did not crash, the process would get orphaned. This fix includes modifications to the starter that change its lifecycle. The starter will now wait to be stopped by the pooler gen_server via either the stop_member_async or stop apis. The stop_member_async api is called on the error path and the stop api is called on the success path. Additionally, pooler gen_server bookkeeping is fixed to correctly update the pool state with regard to starting members. Previously, pool record was not updated with the starting members list returned from the non_stale filter.
f93525d
to
4c0a457
Compare
Of/kill stale started members
Clean up starting members that took too long to start. Corrects some bookkeeping issues with regard to starting members.