Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
netty: default grace time for RPCs can leak memory
Using Long.MAX_VALUE as the delay for Netty's NioEventLoop#schedule can cause (long) deadlines for scheduled tasks to wrap into negative values, which is unspecified behavior. Recent versions of netty are guarding against overflows, but not all versions of grpc-java are using a recent enough netty. When connections are gracefully closed, Netty's Http2ConnectionHandler sets up a timeout task forcing resources to be freed after a grace period. When their deadlines wrap into negative values, a race was observed in production systems (with grpc-java <= 1.12.1) causing Netty to never properly release buffers associated with active streams in the connection being (gracefully) closed.
- Loading branch information