Clarifications after review of the implementation:
After a network partition heals, the members must merge their lists of members again for the cluster to get back to a single singleton node. This relies on XWIKI-25245 (the members are reconciled from each new view, including a merge view), so XWIKI-25245 has to be merged first.
The election uses the members of the network view directly (the priority is carried by the network address of each member), so it does not depend on the exchange of the member identifiers.
A negative observation.remote.singletonPriority always wins: such a member is never the singleton node, even when no channel is running. The rules are applied in this order: stopping (false), remote observation disabled (true), negative priority (false), no running channel (true), election.
The answer is cached and updated when the members change, the change event is also sent (synchronously) when the instance stops, with or without cluster, and the base listener reads the current state when a change is notified, so an outdated notification does not start the work twice or on a stopping instance.
This message was sent by Atlassian Jira (v9.3.0#930000-sha1:287aeb6)
If image attachments aren't displayed, see this article.