From 736b3986111e0d0bcdf0ca319536500c65ca5639 Mon Sep 17 00:00:00 2001 From: ZHANG Dapeng Date: Tue, 14 Dec 2021 17:55:48 -0800 Subject: [PATCH] core: fix race condition in idleTimer & ManagedChannel#enterIdle PR for Spikhalskiy/grpc-java@6d260b8 Hot fix of #8714 --- core/src/main/java/io/grpc/internal/ManagedChannelImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/main/java/io/grpc/internal/ManagedChannelImpl.java b/core/src/main/java/io/grpc/internal/ManagedChannelImpl.java index 2e079078fc7..601c7740ca4 100644 --- a/core/src/main/java/io/grpc/internal/ManagedChannelImpl.java +++ b/core/src/main/java/io/grpc/internal/ManagedChannelImpl.java @@ -349,6 +349,9 @@ private class IdleModeTimer implements Runnable { @Override public void run() { + if (lbHelper == null) { + return; + } enterIdleMode(); } }