From 3cdb8901b4d8ab2c90056e316b8780688c40e1f8 Mon Sep 17 00:00:00 2001 From: Rick Parker Date: Thu, 5 Oct 2023 11:16:12 +0100 Subject: [PATCH] Don't bind unless shared memory says it is free (#7520) --- .../java/net/corda/testing/driver/SharedMemoryIncremental.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/testing/node-driver/src/main/java/net/corda/testing/driver/SharedMemoryIncremental.java b/testing/node-driver/src/main/java/net/corda/testing/driver/SharedMemoryIncremental.java index 7d97f33140..88e6e726d7 100644 --- a/testing/node-driver/src/main/java/net/corda/testing/driver/SharedMemoryIncremental.java +++ b/testing/node-driver/src/main/java/net/corda/testing/driver/SharedMemoryIncremental.java @@ -76,8 +76,7 @@ public class SharedMemoryIncremental extends PortAllocation { newValue = (oldValue + 1); } boolean reserveSuccess = UNSAFE.compareAndSwapLong(null, startingAddress, oldValue, newValue); - boolean portAvailable = isLocalPortAvailable(newValue); - loopSuccess = reserveSuccess && portAvailable; + loopSuccess = reserveSuccess && isLocalPortAvailable(newValue); } while (!loopSuccess); return (int) newValue;