diff --git a/java/src/org/openqa/selenium/grid/sessionqueue/local/LocalNewSessionQueue.java b/java/src/org/openqa/selenium/grid/sessionqueue/local/LocalNewSessionQueue.java index d673cc342de95..9bad66db5b6f7 100644 --- a/java/src/org/openqa/selenium/grid/sessionqueue/local/LocalNewSessionQueue.java +++ b/java/src/org/openqa/selenium/grid/sessionqueue/local/LocalNewSessionQueue.java @@ -216,7 +216,7 @@ public HttpResponse addToQueue(SessionRequest request) { boolean sessionCreated = data.latch.await(requestTimeout.toMillis(), MILLISECONDS); if (sessionCreated) { - result = data.result; + result = data.getResult(); } else { result = Either.left(new SessionNotCreatedException("New session request timed out")); } @@ -465,7 +465,7 @@ private class Data { public final Instant endTime; private final CountDownLatch latch = new CountDownLatch(1); - public Either result; + private Either result; private boolean complete; public Data(Instant enqueued) { @@ -473,6 +473,10 @@ public Data(Instant enqueued) { this.result = Either.left(new SessionNotCreatedException("Session not created")); } + public synchronized Either getResult() { + return result; + } + public synchronized void setResult( Either result) { if (complete) {