Skip to content

Commit

Permalink
Do not attempt to dump state if the thread is already interrupted.
Browse files Browse the repository at this point in the history
  • Loading branch information
basilevs committed Apr 3, 2024
1 parent 55af2b7 commit 9643ee2
Showing 1 changed file with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -953,17 +953,16 @@ private IStatus internalExecute(Command command, long timeout, IProgressMonitor
try {
long stop = System.currentTimeMillis() + timeout;
return computeInNewSession(TimeoutInterruption.forTimeout(monitor, timeout, this), session -> {
ExecutionStatus result;
restoreState(session, properties);
try {
Command commandCopy = command;
IProcess process = session.execute(commandCopy);
IStatus processResult = process.waitFor(stop - System.currentTimeMillis(), monitor);
return new ExecutionStatus(processResult);
} finally {
if (monitor == null || !monitor.isCanceled()) {
dumpState(session);
}
Command commandCopy = command;
IProcess process = session.execute(commandCopy);
IStatus processResult = process.waitFor(stop - System.currentTimeMillis(), monitor);
result = new ExecutionStatus(processResult);
if (monitor == null || !monitor.isCanceled()) {
dumpState(session);
}
return result;
});
} catch (CoreException e) {
throw new CoreException(new MultiStatus(PLUGIN_ID, 0, new IStatus[] { ((CoreException) e).getStatus() },
Expand Down

0 comments on commit 9643ee2

Please sign in to comment.