celestia-node icon indicating copy to clipboard operation
celestia-node copied to clipboard

fix(grpc): correctly wait for ClientConn to reach Ready state

Open Fibonacci747 opened this issue 1 month ago • 0 comments

The previous readiness check used WaitForStateChange(ctx, connectivity.Ready), which waits for a transition out of Ready rather than into Ready, providing no guarantee that the connection became ready and often returning immediately. This caused startup paths and tests to proceed without a truly established gRPC connection. This change replaces that usage with a proper loop that calls Connect(), polls GetState(), breaks on Ready, fails on Shutdown, and uses WaitForStateChange(ctx, state) with the provided context for timeouts. This ensures connections are actually ready before proceeding.

Fibonacci747 avatar Nov 10 '25 06:11 Fibonacci747