doTask

Note: Long-running implementations MUST periodically test
Thread.interrupted() and MUST throw an exception, such as
InterruptedException, if they are interrupted. This behavior
allows tasks to be canceled in a timely manner.

If you ignore or fail to test Thread.interrupted() then your task
CAN NOT be aborted. If it is Future.cancel(boolean) with
false then the task will run to completion even though it
has been cancelled (but the Future will appear to have been
cancelled).

If you simply return rather than throwing an exception
then the WriteExecutorService will assume that your task
completed and your (partial) results will be made restart-safe at the
next commit!