grpc Channel Stuck in TRANSIENT_FAILURE state

26 views
Skip to first unread message

罗旭皓

unread,
Jul 30, 2025, 6:24:55 PMJul 30
to grpc.io
I have a bare-minimum example of two servers connecting to each other via grpc (I'm planning to implement some primary-backup server). Each server starts its grpc server and tries to conenct to the other. Here is the src code of the server as well the script I used to run them:

What I observe is that the channel state is always in TRANSIENT_FAILURE state. the log looks like this:

13:52:54.513 [main] INFO  com.example.BiDirectionalServer - Server server2 started on port 5002 [BiDirectionalServer.java:33]
13:52:54.592 [main] INFO  com.example.BiDirectionalServer - Attempting to connect to peer at localhost:5002 [BiDirectionalServer.java:49]
13:52:54.652 [main] INFO  com.example.BiDirectionalServer - Channel state: IDLE [BiDirectionalServer.java:60]
13:52:55.654 [main] INFO  com.example.BiDirectionalServer - Channel state: TRANSIENT_FAILURE [BiDirectionalServer.java:60]
13:52:56.518 [main] INFO  com.example.BiDirectionalServer - Attempting to connect to peer at localhost:5001 [BiDirectionalServer.java:49]
13:52:56.576 [main] INFO  com.example.BiDirectionalServer - Channel state: IDLE [BiDirectionalServer.java:60]
13:52:56.659 [main] INFO  com.example.BiDirectionalServer - Channel state: TRANSIENT_FAILURE [BiDirectionalServer.java:60]
13:52:57.581 [main] INFO  com.example.BiDirectionalServer - Channel state: TRANSIENT_FAILURE [BiDirectionalServer.java:60]
13:52:57.664 [main] INFO  com.example.BiDirectionalServer - Channel state: TRANSIENT_FAILURE [BiDirectionalServer.java:60]
13:52:58.585 [main] INFO  com.example.BiDirectionalServer - Channel state: TRANSIENT_FAILURE [BiDirectionalServer.java:60]
13:52:58.670 [main] INFO  com.example.BiDirectionalServer - Channel state: TRANSIENT_FAILURE [BiDirectionalServer.java:60]
13:52:59.587 [main] INFO  com.example.BiDirectionalServer - Channel state: TRANSIENT_FAILURE [BiDirectionalServer.java:60]
13:52:59.675 [main] INFO  com.example.BiDirectionalServer - Channel state: TRANSIENT_FAILURE [BiDirectionalServer.java:60]
13:53:00.590 [main] INFO  com.example.BiDirectionalServer - Channel state: TRANSIENT_FAILURE [BiDirectionalServer.java:60]
13:53:00.678 [main] INFO  com.example.BiDirectionalServer - Channel state: TRANSIENT_FAILURE [BiDirectionalServer.java:60]
13:53:01.596 [main] INFO  com.example.BiDirectionalServer - Channel state: TRANSIENT_FAILURE [BiDirectionalServer.java:60]
13:53:01.684 [main] INFO  com.example.BiDirectionalServer - Channel state: TRANSIENT_FAILURE [BiDirectionalServer.java:60]
13:53:02.602 [main] INFO  com.example.BiDirectionalServer - Channel state: TRANSIENT_FAILURE [BiDirectionalServer.java:60]
13:53:02.690 [main] INFO  com.example.BiDirectionalServer - Channel state: TRANSIENT_FAILURE [BiDirectionalServer.java:60]
13:53:03.608 [main] INFO  com.example.BiDirectionalServer - Channel state: TRANSIENT_FAILURE [BiDirectionalServer.java:60]
13:53:03.693 [main] INFO  com.example.BiDirectionalServer - Channel state: TRANSIENT_FAILURE [BiDirectionalServer.java:60]
13:53:04.614 [main] INFO  com.example.BiDirectionalServer - Channel state: TRANSIENT_FAILURE [BiDirectionalServer.java:60]
13:53:04.697 [main] WARN  com.example.BiDirectionalServer - Could not connect to peer at localhost:5002 (state: TRANSIENT_FAILURE) [BiDirectionalServer.java:82]
13:53:05.620 [main] INFO  com.example.BiDirectionalServer - Channel state: TRANSIENT_FAILURE [BiDirectionalServer.java:60]
13:53:06.625 [main] WARN  com.example.BiDirectionalServer - Could not connect to peer at localhost:5001 (state: TRANSIENT_FAILURE) [BiDirectionalServer.java:82]

Could anyone point me out where I'm doing wrong? Thanks!

Reply all
Reply to author
Forward
0 new messages