peer Registration Race when client connects to the signal server #22

Closed
opened 2025-11-20 05:04:59 -05:00 by saavagebueno · 0 comments
Owner

Originally created by @braginini on GitHub (Jun 17, 2021).

Originally assigned to: @braginini on GitHub.

What?
Due to the async nature of gRPC bi-directional streams, the client gets successfully connected to the stream before the Signal server registers it in the registry. Therefore signal/client.WaitConnected() returns before the peer was registered.
This is visible in the test environments when signal and peers are "close", not likely to happen in the production scenario.

Why?
A peer has to start communication with other peers only when it has been registered therefore signal/client.WaitConnected() should unblock when the peer has been actually registered on signal

How?
We could introduce additional methods to register peer on signal or use meta headers of gRPC on ConnectStream

Originally created by @braginini on GitHub (Jun 17, 2021). Originally assigned to: @braginini on GitHub. *What?* Due to the async nature of gRPC bi-directional streams, the client gets successfully connected to the stream before the Signal server registers it in the registry. Therefore signal/client.WaitConnected() returns before the peer was registered. This is visible in the test environments when signal and peers are "close", not likely to happen in the production scenario. *Why?* A peer has to start communication with other peers only when it has been registered therefore signal/client.WaitConnected() should unblock when the peer has been actually registered on signal *How?* We could introduce additional methods to register peer on signal or use meta headers of gRPC on [ConnectStream](https://github.com/wiretrustee/wiretrustee/blob/main/signal/signal.go#L49)
saavagebueno added the bug label 2025-11-20 05:04:59 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#22