Skip to content

Commit

Permalink
Correctly release txpool save and restore lock in case of exceptions
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
  • Loading branch information
fab-10 committed Aug 16, 2024
1 parent 8523ed0 commit 4cbb5ff
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,8 @@ private CompletableFuture<Void> serializeAndDedupOperation(

isCancelled.set(false);
operationInProgress.set(
CompletableFuture.runAsync(operation).thenRun(diskAccessLock::release));
CompletableFuture.runAsync(operation)
.whenComplete((res, err) -> diskAccessLock.release()));
return operationInProgress.get();
} else {
CompletableFuture.failedFuture(
Expand Down

0 comments on commit 4cbb5ff

Please sign in to comment.