void (@NotNull ProgressIndicator indicator) { service().runTaskSynchronously(new DumbModeTask() { @Override public void performInDumbMode(@NotNull ProgressIndicator indicator) { secondTaskCompleted.set(true); } }); // cancel parent task now. The child task should complete successfully throw new ProcessCanceledException(); }