Tsz-wo Sze created RATIS-2164:
---------------------------------
Summary: LeakDetector has a race condition
Key: RATIS-2164
URL: https://issues.apache.org/jira/browse/RATIS-2164
Project: Ratis
Issue Type: Improvement
Components: util
Reporter: Tsz-wo Sze
In the IllegalStateException, the code assert that the allLeaks set was
non-empty. However, when it printed the message, the allLeaks set became 0
size. See
https://github.com/apache/ratis/actions/runs/11047422561/job/30704978190?pr=1154#step:5:1100
{code}
Suppressed: java.lang.IllegalStateException: allLeaks.size = 0
at
org.apache.ratis.util.Preconditions.assertTrue(Preconditions.java:77)
at
org.apache.ratis.util.LeakDetector.assertNoLeaks(LeakDetector.java:107)
at
org.apache.ratis.server.impl.MiniRaftCluster.shutdown(MiniRaftCluster.java:869)
at
org.apache.ratis.grpc.MiniRaftClusterWithGrpc.shutdown(MiniRaftClusterWithGrpc.java:96)
at
org.apache.ratis.server.impl.MiniRaftCluster$Factory$Get.runWithNewCluster(MiniRaftCluster.java:149)
at
org.apache.ratis.server.impl.MiniRaftCluster$Factory$Get.runWithNewCluster(MiniRaftCluster.java:121)
at
org.apache.ratis.InstallSnapshotFromLeaderTests.testInstallSnapshotLeaderSwitch(InstallSnapshotFromLeaderTests.java:96)
at
org.apache.ratis.grpc.TestLeaderInstallSnapshotWithGrpc.testInstallSnapshotLeaderSwitch(TestLeaderInstallSnapshotWithGrpc.java:53)
at java.lang.reflect.Method.invoke(Method.java:498)
... 44 more
{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)