no need to synchronize on Queue as queue is using a Lock and this under certain conditions can generate a deadlock. look at the dump attached to the issue
@@ -71,7 +71,6 @@ public final class FutureImpl extends AsyncFutureImpl<Executable> implements Que
@Override
public boolean cancel(boolean mayInterruptIfRunning) {
Queue q = Jenkins.get().getQueue();
- synchronized (q) {
synchronized (this) {
if(!executors.isEmpty()) {
if(mayInterruptIfRunning)
@@ -82,7 +81,6 @@ public final class FutureImpl extends AsyncFutureImpl<Executable> implements Que
return q.cancel(task);
}
}
- }
@Override
public synchronized void setAsCancelled() {
