This is an automated email from the ASF dual-hosted git repository.
lhotari pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new fbcfacf324e [fix][ml] Fix eviction trigger race that cleared the
in-progress marker (#25988)
fbcfacf324e is described below
commit fbcfacf324ef02c7c6fe639056fc7aa779262767
Author: Matteo Merli <[email protected]>
AuthorDate: Wed Jun 10 00:19:11 2026 -0700
[fix][ml] Fix eviction trigger race that cleared the in-progress marker
(#25988)
---
.../bookkeeper/mledger/impl/cache/RangeEntryCacheManagerImpl.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git
a/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/cache/RangeEntryCacheManagerImpl.java
b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/cache/RangeEntryCacheManagerImpl.java
index d1d9955fe6a..4b85687a531 100644
---
a/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/cache/RangeEntryCacheManagerImpl.java
+++
b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/cache/RangeEntryCacheManagerImpl.java
@@ -142,9 +142,9 @@ public class RangeEntryCacheManagerImpl implements
EntryCacheManager {
while (evictionCompletionFuture == null) {
evictionCompletionFuture = evictionInProgress.get();
if (evictionCompletionFuture == null) {
- evictionCompletionFuture = evictionInProgress.updateAndGet(
- currentValue -> currentValue == null ? new
CompletableFuture<>() : null);
- if (evictionCompletionFuture != null) {
+ CompletableFuture<Void> newEvictionFuture = new
CompletableFuture<>();
+ if (evictionInProgress.compareAndSet(null,
newEvictionFuture)) {
+ evictionCompletionFuture = newEvictionFuture;
triggerEvictionToMakeSpace(evictionCompletionFuture);
}
}