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

Of/kill stale started members #31

Merged
merged 1 commit into from
Sep 30, 2014

Conversation

oferrigni
Copy link
Collaborator

Clean up starting members that took too long to start. Corrects some bookkeeping issues with regard to starting members.

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),
Copy link
Collaborator

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 :)

Copy link
Collaborator

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

Copy link
Collaborator Author

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.

@seth
Copy link
Collaborator

seth commented Sep 30, 2014

Nice cleanups. Please squash to a single commit and I'll get this merged asap.

@seth
Copy link
Collaborator

seth commented Sep 30, 2014

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.
oferrigni added a commit that referenced this pull request Sep 30, 2014
@oferrigni oferrigni merged commit 0ecc29b into epgsql:master Sep 30, 2014
@oferrigni oferrigni deleted the of/kill_stale_started_members branch September 30, 2014 04:20
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