diff --git a/d2/src/main/java/com/linkedin/d2/balancer/util/WarmUpLoadBalancer.java b/d2/src/main/java/com/linkedin/d2/balancer/util/WarmUpLoadBalancer.java index eafad048e1..4ea82df76d 100644 --- a/d2/src/main/java/com/linkedin/d2/balancer/util/WarmUpLoadBalancer.java +++ b/d2/src/main/java/com/linkedin/d2/balancer/util/WarmUpLoadBalancer.java @@ -153,7 +153,8 @@ public void onSuccess(None result) { private void prepareWarmUp(Callback callback) { - AtomicBoolean hasTimedOut = new AtomicBoolean(false); + // not to be thread-safe, but just to be effectively final to be used in lambdas + final AtomicBoolean hasTimedOut = new AtomicBoolean(false); try { _downstreamServicesFetcher.getServiceNames(serviceNames -> {