Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,11 @@ private void runFullReasonerRemotely(RemoteReasonerService remoteReasonerService
Thread.currentThread().interrupt();
LOG.info(ie.getMessage(), ie);
} catch (CancellationException ce) {
// Cancels the local wait only: the server keeps classifying, because the RPC has
// no cancellation hook yet. The user stops watching, not the work.
LOG.info(ce.getMessage(), ce);
task.updateMessage("Stopped waiting for the remote reasoner");
// Stops the run on the server, not just the wait: cancelling the task is what the
// remote client watches for, and it then asks the server to cancel. Expected, so
// logged without a stack trace.
LOG.info("Remote reasoner cancelled");
task.updateMessage("Cancelled full reasoner");
task.cancel();
ProgressHelper.cancel(javafxTask);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ protected RemoteReasonerService.RemoteReasonerOutcome compute() throws Exception
reasonerService.runFullReasoner((step, totalSteps, message) -> {
updateMessage("Step " + step + " of " + totalSteps + ": " + message);
updateProgress(step, totalSteps);
});
}, this);
// this, as the tracker: Komet's cancel calls cancel() on this task, and the remote
// service watches it to stop the classification server-side.
updateMessage("Reasoner run complete in " + durationString());
if (outcomeConsumer != null) {
outcomeConsumer.accept(outcome);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ private void handleRetention() {
@Override
protected void cancelled() {
this.trackingCallable.cancel();
// Removed as succeeded() and failed() do: left in executingTasks, a cancelled task keeps
// the Activity indicator spinning forever.
TaskListsService.get().pendingTasks().remove(this);
TaskListsService.get().executingTasks().remove(this);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<groupId>dev.ikm.komet</groupId>
<artifactId>komet-parent</artifactId>
<name>KOMET</name>
<version>1.59.5-SNAPSHOT</version>
<version>1.59.5-reasoner_cancel-SNAPSHOT</version>
<packaging>pom</packaging>
<inceptionYear>2015</inceptionYear>
<licenses>
Expand Down
Loading