diff --git a/hugegraph-pd/hg-pd-common/src/main/java/org/apache/hugegraph/pd/common/PartitionCache.java b/hugegraph-pd/hg-pd-common/src/main/java/org/apache/hugegraph/pd/common/PartitionCache.java index 9b98cbbb03..31cc29deed 100644 --- a/hugegraph-pd/hg-pd-common/src/main/java/org/apache/hugegraph/pd/common/PartitionCache.java +++ b/hugegraph-pd/hg-pd-common/src/main/java/org/apache/hugegraph/pd/common/PartitionCache.java @@ -85,7 +85,7 @@ public void waitGraphLock(String graphName) { public void lockGraph(String graphName) { var lock = getOrCreateGraphLock(graphName); - while (lock.compareAndSet(false, true)) { + while (!lock.compareAndSet(false, true)) { Thread.onSpinWait(); } }