Skip to content

Commit

Permalink
Propagate the internal listener port (ServiceWeaver#371)
Browse files Browse the repository at this point in the history
In the current implementation, every weavelet will listen for internal
traffic at an arbitrary port. However, for some deployers (e.g.,
kubernetes based deployer), we will prestart the listeners hence the
port has to be propagated from the deployer.

This PR adds a new field `internal_port` that contains the port number
for the internal listener. By default this is 0, which preserves the
current behavior. However, in a future PR, the `internal_port` value
will be used by the kubernetes deployer.
  • Loading branch information
rgrandl committed Jun 1, 2023
1 parent c989c90 commit 8477b09
Show file tree
Hide file tree
Showing 3 changed files with 367 additions and 343 deletions.
2 changes: 1 addition & 1 deletion internal/envelope/conn/weavelet_conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,5 +362,5 @@ func listen(info *protos.EnvelopeInfo) (net.Listener, error) {
}

// Create the listener
return net.Listen("tcp", fmt.Sprintf("%s:0", host))
return net.Listen("tcp", fmt.Sprintf("%s:%d", host, info.InternalPort))
}
Loading

0 comments on commit 8477b09

Please sign in to comment.