Skip to content

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.

2 participants