Skip to content
Open
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 @@ -748,23 +748,21 @@ else if (sysStopping && X.hasCause(e, InterruptedException.class, IgniteInterrup
*/
public void cancel(boolean sys) {
try {
final ComputeJob job0 = job;
if (log.isDebugEnabled())
log.debug("Cancelling job: " + ses);

status = CANCELLED;

if (sys)
sysCancelled = true;

if (job0 != null) {
if (log.isDebugEnabled())
log.debug("Cancelling job: " + ses);

status = CANCELLED;
final ComputeJob job0 = job;

U.wrapThreadLoader(dep.classLoader(), (IgniteRunnable)() -> {
try (Scope ignored = ctx.security().withContext(secCtx)) {
job0.cancel();
}
});
}
U.wrapThreadLoader(dep.classLoader(), (IgniteRunnable)() -> {
try (Scope ignored = ctx.security().withContext(secCtx)) {
job0.cancel();
}
});

// Interrupting only when all 'cancelled' flags are set.
// This allows the 'job' to determine it's a cancellation.
Expand Down Expand Up @@ -1091,6 +1089,11 @@ ComputeJobStatusEnum status() {
return jobId.hashCode();
}

/** {@inheritDoc} */
@Override public boolean isCancelled() {
return status == CANCELLED;
}

/** {@inheritDoc} */
@Override protected void onCancel(boolean firstCancelRequest) {
if (firstCancelRequest)
Expand Down
Loading