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

Data race detected by TSAN in MpscGrowableArrayQueue.java line 519 #892

Closed
jlavallee opened this issue Mar 24, 2023 · 3 comments
Closed

Comments

@jlavallee
Copy link

We recently upgraded from Caffeine 2.x to 3.1.5 and TSAN has detected a data race at MpscGrowableArrayQueue.java:519

Stack trace below, I can provide a more detailed one privately if desired.

WARNING: ThreadSanitizer: data race (pid=8703)
Write of size 4 at 0x0000c93fb424 by thread T31 (mutexes: write M0):
#0 com.github.benmanes.caffeine.cache.BaseMpscLinkedArrayQueue.resize(J[Ljava/lang/Object;JLjava/lang/Object;)V MpscGrowableArrayQueue.java:519
#1 com.github.benmanes.caffeine.cache.BaseMpscLinkedArrayQueue.offer(Ljava/lang/Object;)Z MpscGrowableArrayQueue.java:276
#2 com.github.benmanes.caffeine.cache.BoundedLocalCache.afterWrite(Ljava/lang/Runnable;)V BoundedLocalCache.java:1520
#3 com.github.benmanes.caffeine.cache.BoundedLocalCache.replace(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Z)Z BoundedLocalCache.java:2612
#4 com.github.benmanes.caffeine.cache.LocalAsyncCache.lambda$handleCompletion$7(Ljava/util/concurrent/atomic/AtomicBoolean;JLjava/lang/Object;Ljava/util/concurrent/CompletableFuture;ZLjava/lang/Object;Ljava/lang/Throwable;)V LocalAsyncCache.java:219
#5 com.github.benmanes.caffeine.cache.LocalAsyncCache$$Lambda$495.accept(Ljava/lang/Object;Ljava/lang/Object;)V ??
#6 java.util.concurrent.CompletableFuture.uniWhenComplete(Ljava/lang/Object;Ljava/util/function/BiConsumer;Ljava/util/concurrent/CompletableFuture$UniWhenComplete;)Z CompletableFuture.java:859
#7 java.util.concurrent.CompletableFuture.uniWhenCompleteStage(Ljava/util/concurrent/Executor;Ljava/util/function/BiConsumer;)Ljava/util/concurrent/CompletableFuture; CompletableFuture.java:883
#8 java.util.concurrent.CompletableFuture.whenComplete(Ljava/util/function/BiConsumer;)Ljava/util/concurrent/CompletableFuture; CompletableFuture.java:2251
#9 com.github.benmanes.caffeine.cache.LocalAsyncCache.handleCompletion(Ljava/lang/Object;Ljava/util/concurrent/CompletableFuture;JZ)V LocalAsyncCache.java:200
#10 com.github.benmanes.caffeine.cache.LocalAsyncCache.put(Ljava/lang/Object;Ljava/util/concurrent/CompletableFuture;)V LocalAsyncCache.java:193
#11

@ben-manes
Copy link
Owner

Hi Jeff,

Please see #556. This and the other TSAN issue are benign so closing, but please reopen if you believe otherwise.

@jlavallee
Copy link
Author

Thanks! I expect we may come across a few more of these following our Caffeine update, should I open new issues for them as they arise, or perhaps re-use this bug for all 3.1.5 TSAN issues?

@ben-manes
Copy link
Owner

Sure, whatever you prefer. I'll look at them regardless.

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

No branches or pull requests

2 participants