The reason almost certainly is because your breakpoint in the debugger stops the main thread, but none of the background threads are those in the ExecutorService. When debugging in eclipse, you can change the breakpoint to stop all threads, not just the main one.
If debugging a job submission and immediate cancellation is so fast that you cancel the task before it starts even once. Try adding a sleep delay between these lines:
final Future<String> future = pool.submit(new TaskChecksForInterruptedBit()); Thread.sleep(1000); final boolean wasJustCancelled = future.cancel(true);
source share