From 685a66ab1e099910d03509a7c698237541a72e82 Mon Sep 17 00:00:00 2001 From: Shawn Pearce Date: Sun, 19 Jun 2016 22:30:00 -0700 Subject: [PATCH] Do not allow index futures to be cancelled Once a change is written to the backing store (ReviewDb or NoteDb), it should also be written into the secondary index, even if the user tries to abort the current operation (e.g. presses Ctrl-C on a running `git push`). Don't allow cancellation of a higher level future to go down into the index update future. This also better protects Lucene from seeing an interrupt while using the secondary index and closing the NIOFSDirectory. Change-Id: I8027a6226a5a1f7196506a0388a66d0568f67a5c --- .../com/google/gerrit/server/index/change/ChangeIndexer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/index/change/ChangeIndexer.java b/gerrit-server/src/main/java/com/google/gerrit/server/index/change/ChangeIndexer.java index 8f324b3ed1..fa4f2fa1bc 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/index/change/ChangeIndexer.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/index/change/ChangeIndexer.java @@ -246,7 +246,8 @@ public class ChangeIndexer { } private CheckedFuture submit(Callable task) { - return Futures.makeChecked(executor.submit(task), MAPPER); + return Futures.makeChecked( + Futures.nonCancellationPropagating(executor.submit(task)), MAPPER); } private class IndexTask implements Callable {