Cannot reconnect to gRPC server after client crashed

773 views Asked by At

I did a lot of research but could not find a solution for my problem with gRPC:

Summary; After my swift gRPC client application crashes, no gRPC client can connect to my gRPC Server anymore (see errors below)

My Setup: I have a Swift frontend application and a Rust backend. The rust backend runs a gRPC Server (tonic) https://github.com/hyperium/tonic to which a rust client (also tonic) and a Swift client (https://github.com/grpc/grpc-swift) can connect to. After the Swift client crashes, none of the clients can connect anymore to the server.

The rust client reports: Error: Status { code: Cancelled, message: "h2 protocol error: protocol error: stream no longer needed" }

The swift client reports: StreamClosed(streamID: HTTP2StreamID(1), errorCode: HTTP2ErrorCode<0x8 Cancel>, location: ".../swift-nio-http2/Sources/NIOHTTP2/HTTP2StreamChannel.swift:820")

What I've tried I setup a http2 keepalive in the server, but that didn't do anything. I tried to reproduce the same effect by purposefully crashing the rust client - without success.

I'm not even sure wether to look at the swift-grpc and tonic libraries or grpc itself (for me it looks like the server closes the stream on purpose)..
Has anyone an idea what i could do to fix this? Thanks in advance!

0

There are 0 answers