GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [fix][ml] Fix eviction trigger race that cleared the in-progress mark… · ascentstream/pulsar@6ea72a9

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/cache
    • RangeEntryCacheManagerImpl.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/cache/RangeEntryCacheManagerImpl.java‎

Copy file name to clipboardExpand all lines: managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/cache/RangeEntryCacheManagerImpl.java
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ Optional<CompletableFuture<Void>> triggerEvictionWhenNeeded() {
142142
while (evictionCompletionFuture == null) {
143143
evictionCompletionFuture = evictionInProgress.get();
144144
if (evictionCompletionFuture == null) {
145-
evictionCompletionFuture = evictionInProgress.updateAndGet(
146-
currentValue -> currentValue == null ? new CompletableFuture<>() : null);
147-
if (evictionCompletionFuture != null) {
145+
CompletableFuture<Void> newEvictionFuture = new CompletableFuture<>();
146+
if (evictionInProgress.compareAndSet(null, newEvictionFuture)) {
147+
evictionCompletionFuture = newEvictionFuture;
148148
triggerEvictionToMakeSpace(evictionCompletionFuture);
149149
}
150150
}

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.