Skip to content

Use [:noconnect] on all cross-node sends#12

Merged
twinn merged 1 commit into
mainfrom
noconnect-fix
Apr 10, 2026
Merged

Use [:noconnect] on all cross-node sends#12
twinn merged 1 commit into
mainfrom
noconnect-fix

Conversation

@twinn

@twinn twinn commented Apr 10, 2026

Copy link
Copy Markdown
Owner

Matches pg.erl's use of erlang:send/3 with [noconnect]. Without this flag, send/2 to a disconnected peer triggers a connection attempt that blocks the GenServer until the attempt times out or succeeds. With [:noconnect], the message is silently dropped if the peer isn't connected — the next nodeup will trigger a fresh discover/sync anyway, so nothing is lost.

Applied to:

  • broadcast/2 (the main send loop for join/leave/update gossip)
  • init/1 discover broadcast to all known nodes
  • nodeup handler discover to the new node
  • handle_discover reply to a discovering peer

This was part of PR #9 but landed after the squash-merge. Cherry-picked onto main.

Matches pg.erl's use of erlang:send/3 with [noconnect]. Without
this flag, send/2 to a disconnected peer triggers a connection
attempt that blocks the GenServer until the attempt times out or
succeeds. With [:noconnect], the message is silently dropped if the
peer isn't connected — the next nodeup will trigger a fresh
discover/sync anyway, so nothing is lost.

Applied to:
  - broadcast/2 (the main send loop for join/leave/update gossip)
  - init/1 discover broadcast to all known nodes
  - nodeup handler discover to the new node
  - handle_discover reply to a discovering peer
@twinn
twinn merged commit 6a20f5a into main Apr 10, 2026
3 checks passed
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.

1 participant