Discussions

Ask a Question
Back to All

Handling unexpected node exit and rejoin on different port

I've been playing with lasp_pg from the Elixir terminal and noticed this behavior:

I'm doing this from two elixir terminal sessions:

Start node lasp1.
Start node lasp2. Join to lasp1. Kill session (^C^C)
Lasp1 says lasp2 is disconnected.
Start node lasp2 again. Join to lasp1.
Lasp1 now has two lasp2's in the membership list and continues to say that lasp2 is disconnected.

I understand why it's doing this - the new lasp2 is connecting on a different port.

The main issue is that, to stop the errors from coming in, I must force lasp2 to leave to clear out the previous lasp2 connection and then have lasp2 join again.

Is there a way to force the lasp2's old connection to 'expire' based on its old port and remove it from the membership?