There are some gRPC calls that require the connection to stay connected for more than 5 minutes, and the connection will be idle until the operation is completed.
I tried keepalive
settings and even context.WithTimeout()
but the gRPC connection times out after 5 minutes (code = unknown desc = stream timeout")
How to increase the idle timeout for such gRPC calls?
Have you tried it
clientDeadline := time.Now().Add(time.Duration(*deadlineMs) * time.Millisecond) ctx, cancel := context.WithDeadline(ctx, clientDeadline)
Similar to the definition in the official grpc documentation. This is the //m.sbmmt.com/link/491723c615d42eb8b44650bcbe384561 link.
The above is the detailed content of Increase gRPC timeout in Go. For more information, please follow other related articles on the PHP Chinese website!