From 9a09021897fed86df86a47e941b75778bcb0d4fa Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Mon, 6 Jun 2022 09:34:33 -0700 Subject: [PATCH] core: Add missed internal comment about idle mode workaround This should have been included in #8746 but wasn't. --- 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 b9ad2a1840..b0d07efe25 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 @@ final class ManagedChannelImpl extends ManagedChannel implements @Override public void run() { + // Workaround timer scheduled while in idle mode. This can happen from handleNotInUse() after + // an explicit enterIdleMode() by the user. Protecting here as other locations are a bit too + // subtle to change rapidly to resolve the channel panic. See #8714 if (lbHelper == null) { return; }