When a call on a gracefully-terminating ManagedClientChannel experiences a network error, the call is closed with a message suggesting the error is from channel closing rather than the network.
See my reproduction at https://github.com/benjaminp/grpc_shutdown_bug. The program in that repository
- starts a server
- makes a channel to the server
- starts a server-streaming call on the channel
- (optionally) shuts down the client channel
- forcibly kills the server.
When the client channel is shutdown, the client sees a UNAVAILABLE: Channel shutdown invoked error on server death:
$ ./gradlew run
> Task :run
client: launching server: build/install/streaming-demo-client/bin/streaming-demo-server
client: server pid=234110 port=44637
client: creating channel
client: starting server-streaming RPC
client: reading 1 message
May 15, 2026 3:07:05 PM io.grpc.netty.TcpMetrics loadEpollInfo
INFO: Epoll available during static init of TcpMetrics:false
May 15, 2026 3:07:05 PM io.grpc.netty.TcpMetrics loadEpollInfo
INFO: Epoll available during static init of TcpMetrics:false
client: read: 0
client: shutting down channel (graceful)
client: channel.isShutdown=true isTerminated=false
client: reading another message
client: read: 1
client: server exited with 137
client: draining until error
client: drained with error: io.grpc.StatusException: UNAVAILABLE: Channel shutdown invoked
done
Contrast with the error when the channel is not shutdown:
$ ./gradlew run --args=--noshutdown
> Task :run
client: launching server: build/install/streaming-demo-client/bin/streaming-demo-server
client: server pid=234631 port=39449
client: creating channel
client: starting server-streaming RPC
client: reading 1 message
client: read: 0
client: shutting down channel (graceful)
client: channel.isShutdown=false isTerminated=false
client: reading another message
client: read: 1
client: server exited with 137
client: draining until error
client: drained with error: io.grpc.StatusException: UNAVAILABLE: Network closed for unknown reason
done
I believe the first case should also fail with UNAVAILABLE: Network closed for unknown reason.
When a call on a gracefully-terminating
ManagedClientChannelexperiences a network error, the call is closed with a message suggesting the error is from channel closing rather than the network.See my reproduction at https://github.com/benjaminp/grpc_shutdown_bug. The program in that repository
When the client channel is shutdown, the client sees a
UNAVAILABLE: Channel shutdown invokederror on server death:Contrast with the error when the channel is not shutdown:
I believe the first case should also fail with
UNAVAILABLE: Network closed for unknown reason.