Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flaky-test: DeferredSyncTest.testForceWillAdvanceLacOnlyUpToLastAcknoledgedWrite #4200

Closed
lhotari opened this issue Feb 5, 2024 · 4 comments · Fixed by #4234
Closed

Flaky-test: DeferredSyncTest.testForceWillAdvanceLacOnlyUpToLastAcknoledgedWrite #4200

lhotari opened this issue Feb 5, 2024 · 4 comments · Fixed by #4234

Comments

@lhotari
Copy link
Member

lhotari commented Feb 5, 2024

DeferredSyncTest.testForceWillAdvanceLacOnlyUpToLastAcknoledgedWrite is flaky. The build times out since the test never finishes. This happens quite often.

"main" #1 prio=5 os_prio=0 cpu=1865.56ms elapsed=1477.95s tid=0x00007f34b4028000 nid=0x149f5 waiting on condition  [0x00007f34bcffc000]
   java.lang.Thread.State: TIMED_WAITING (parking)
	at jdk.internal.misc.Unsafe.park([email protected]/Native Method)
	- parking to wait for  <0x000000008ad136e8> (a java.util.concurrent.CompletableFuture$Signaller)
	at java.util.concurrent.locks.LockSupport.parkNanos([email protected]/LockSupport.java:234)
	at java.util.concurrent.CompletableFuture$Signaller.block([email protected]/CompletableFuture.java:1798)
	at java.util.concurrent.ForkJoinPool.managedBlock([email protected]/ForkJoinPool.java:3128)
	at java.util.concurrent.CompletableFuture.timedGet([email protected]/CompletableFuture.java:1871)
	at java.util.concurrent.CompletableFuture.get([email protected]/CompletableFuture.java:2027)
	at org.apache.bookkeeper.common.concurrent.FutureUtils.result(FutureUtils.java:80)
	at org.apache.bookkeeper.common.concurrent.FutureUtils.result(FutureUtils.java:61)
	at org.apache.bookkeeper.client.DeferredSyncTest.testForceWillAdvanceLacOnlyUpToLastAcknoledgedWrite(DeferredSyncTest.java:178)

Example failure: https://github.com/apache/bookkeeper/actions/runs/7776777094/job/21204429600?pr=4196#step:12:422

@lhotari
Copy link
Member Author

lhotari commented Feb 5, 2024

@eolivelli Any ideas why this test DeferredSyncTest.testForceWillAdvanceLacOnlyUpToLastAcknoledgedWrite hangs forever?

@eolivelli
Copy link
Contributor

Looking at the code I cannot find any obvious problem.
Maybe in resumeBookieWriteAcks things are not working properly ? we are missing some callback

we should reproduce the problem locally

@tmzk1005
Copy link
Contributor

Maybe a thread synchronization problem :

2024-03-20_01-25-DeferredSyncTest

code-block-1 and code-block-3 runs in main thread, but code-block-2 and code-block-4 runs in another thread, when the execution order is 1 -> 2 -> 3 -> 4. callback has no chance to run, so result(forceResult); blocked forever.

@tmzk1005
Copy link
Contributor

cc @eolivelli, please review my code to see if I fix #4200 correctly. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants