From 296f512f4de73a183673d03086153b025fb0a134 Mon Sep 17 00:00:00 2001 From: Konstantin Kolosovsky Date: Fri, 28 Oct 2016 09:44:35 +0300 Subject: [PATCH] vcs: Always invoke "continuation" for "BackgroundTaskGroup" Otherwise "QueueProcessor.waitFor()" (and therefore "BackgroundTaskQueue.waitForTasksToFinish()") will never finish in case of error/cancellation as "QueueProcessor.isProcessing" flag is set to "false" only when running "continuation" --- .../openapi/vcs/actions/BackgroundTaskGroup.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/BackgroundTaskGroup.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/BackgroundTaskGroup.java index edaf03450e25..10c13ca73a11 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/BackgroundTaskGroup.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/BackgroundTaskGroup.java @@ -68,11 +68,6 @@ public class BackgroundTaskGroup extends BackgroundTaskQueue { } } - @Override - public void onSuccess() { - continuation.run(); - } - @Override public void onCancel() { end(); @@ -83,6 +78,11 @@ public class BackgroundTaskGroup extends BackgroundTaskQueue { LOG.error(e); end(); } + + @Override + public void onFinished() { + continuation.run(); + } }.queue()); } @@ -98,12 +98,10 @@ public class BackgroundTaskGroup extends BackgroundTaskQueue { isSuccess = e.isWarning(); } finally { - if (isSuccess) { - continuation.run(); - } - else { + if (!isSuccess) { end(); } + continuation.run(); } }); }