Skip to content

Commit

Permalink
Merge pull request #123 from yrodiere/transactiontimeout
Browse files Browse the repository at this point in the history
Reduce the risk of transaction timeouts
  • Loading branch information
yrodiere authored Jan 8, 2024
2 parents b052cbd + f9dba62 commit 55bc393
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/io/quarkus/search/app/util/SimpleExecutor.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.OptionalInt;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
Expand All @@ -27,7 +28,9 @@ public SimpleExecutor(OptionalInt parallelism) {
defaultedParallelism,
0L,
TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<>(defaultedParallelism * 2),
// We need a fair lock in order to avoid some producers getting locked out
// for much longer than others.
new ArrayBlockingQueue<>(defaultedParallelism * 2, true),
new ThreadPoolProviderImpl.BlockPolicy());
}

Expand Down

0 comments on commit 55bc393

Please sign in to comment.