0

There is a gRPC stream server and client. the client dials to server through gRPC bidirectional stream. The server is running on a kunbeness docker.

After upgrading kubeness server once, the client always gets an EOF error when trying to send a request to stream server. I found that the TCP connection is alive. Why?

Do I need to recreate a new strean by calling "NewStream" API in go-grpc?

func (cc *ClientConn) NewStream(ctx context.Context, desc *StreamDesc, method string, opts ...CallOption) (ClientStream, error)

If I set keep-alive parameters when dialing to gRPC stream server, does the stream would be reconnected automatically or just the TCP connection?

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
lrouter
  • 349
  • 1
  • 5
  • 20

1 Answers1

0

If I set keep-alive parameters when dialing to gRPC stream server, does the stream would be reconnected automatically or just the TCP connection?

Just the TCP connection.

Restarting after an io.EOF is not uncommon practice, so your client-side will need to restart the stream.

Your retry loop may want to add wait/sleep backoff between retries & max retry attempts to guard against a runaway busy loop.

colm.anseo
  • 19,337
  • 4
  • 43
  • 52