Skip to content

fix(coderd/x/nats): default ClusterPort so cluster routes form#26591

Open
cstyan wants to merge 1 commit into
mainfrom
callum/nats-cluster-port
Open

fix(coderd/x/nats): default ClusterPort so cluster routes form#26591
cstyan wants to merge 1 commit into
mainfrom
callum/nats-cluster-port

Conversation

@cstyan

@cstyan cstyan commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

The original NATS Pubusub PRs wrote New but left Options.ClusterPort at the zero value when callers (the cli path) didn't set it. parsePeerAddresses only rewrites peer routes to the NATS port when ClusterPort equals the default, so replicas dialed peers on the relay URL's HTTP port (8080) instead of 6222 and no cluster routes ever formed. Default ClusterPort in New so the listener and route rewrite agree. Adds regression tests.

New left Options.ClusterPort at zero when callers (the cli path) didn't
set it. parsePeerAddresses overwrites each peer's parsed port with
defaultClusterPort (6222), but only when opts.ClusterPort already equals
defaultClusterPort; with the zero value that branch is skipped, so
replicas dialed peers on the relay URL's HTTP port (8080) instead of
6222 and no cluster routes ever formed. Default ClusterPort in New so
the listener and the peer-port rewrite agree. Adds regression tests.

Co-authored-by: Mux <mux@coder.com>
@cstyan cstyan requested a review from sreya June 22, 2026 23:58
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