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
This commit is contained in:
Shawn Pearce 2016-06-19 22:30:00 -07:00 committed by Hugo Arès
parent d2d2d3907f
commit 685a66ab1e

View File

@ -246,7 +246,8 @@ public class ChangeIndexer {
}
private CheckedFuture<?, IOException> submit(Callable<?> task) {
return Futures.makeChecked(executor.submit(task), MAPPER);
return Futures.makeChecked(
Futures.nonCancellationPropagating(executor.submit(task)), MAPPER);
}
private class IndexTask implements Callable<Void> {