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

Include a restart parameter #139

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

balena
Copy link

@balena balena commented May 5, 2020

So Swarm.Tracker can figure out what is intended to happen on :DOWN message.

Basically the version 3.4.0 this change is based on ignores handoffs when the reason isn’t :noconnection (node down event); but this is bad when you do need a handoff during “graceful shutdowns”.

The restart parameter will assume the same values as those passed to Supervisor child spec: if :permanent then a handoff will occur always, if :transient only if the terminate reason is other than :normal | :shutdown | {:shutdown, term}, and if :temporary then it is never restarted, only when the node is down (that's the normal old behaviour which is assumed by default).

That's the same idea described on Supervisor / Restart values but applied to a cluster.

…s intended to happen on `:DOWN` message.

Basically the version 3.4.0 this change is based on ignores handoffs when the reason isn’t :noconnection (node down event); but this is bad when you do need a handoff during “graceful shutdowns”.

The `restart` parameter will assume the same values as those passed to `Supervisor` child spec: if `:permanent` then a handoff will occur always, if `:transient` only if the terminate reason is other than `:normal | :shutdown | {:shutdown, term}`, and if `:temporary` then it is never restarted, only when the node is down (that's the normal old behavior which is assumed by default).
@balena
Copy link
Author

balena commented May 5, 2020

Indicating that the process should have a lifetime that surpasses the natural logic of a regular GenServer means that we're probably willing to adopt a restart: :permanent policy, just like a Supervisor does #117

@balena
Copy link
Author

balena commented May 6, 2020

This PR also solves #11 as the indicated solution of using Swarm.Tracker not always work (needs synchronization when terminating the app or there is no handoff at all).

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.

None yet

2 participants