Skip to content

Commit

Permalink
Add timeouts to crawl chunk join()s
Browse files Browse the repository at this point in the history
  • Loading branch information
eager-signal committed Aug 31, 2023
1 parent a1e534a commit ecd6b01
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ protected void onCrawlChunk(Optional<UUID> fromUuid, List<Account> chunkAccounts
.toList();

try {
CompletableFuture.allOf(deletionFutures.toArray(new CompletableFuture[0])).join();
CompletableFuture.allOf(deletionFutures.toArray(new CompletableFuture[0]))
.orTimeout(10, TimeUnit.MINUTES)
.join();
} catch (final Exception e) {
log.debug("Failed to delete one or more accounts in chunk", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ protected void onCrawlChunk(Optional<UUID> fromUuid, List<Account> chunkAccounts
.toList();

try {
CompletableFuture.allOf(updateFutures.toArray(new CompletableFuture[0])).join();
CompletableFuture.allOf(updateFutures.toArray(new CompletableFuture[0]))
.orTimeout(10, TimeUnit.MINUTES)
.join();
} catch (final Exception e) {
log.debug("Failed to update one or more accounts in chunk", e);
}
Expand Down

0 comments on commit ecd6b01

Please sign in to comment.