diff --git a/core/src/main/java/hudson/model/AbstractProject.java b/core/src/main/java/hudson/model/AbstractProject.java index 099d0d190ded..cceff9c42b19 100644 --- a/core/src/main/java/hudson/model/AbstractProject.java +++ b/core/src/main/java/hudson/model/AbstractProject.java @@ -351,7 +351,10 @@ public EnvVars getEnvironment(@CheckForNull Node node, @NonNull TaskListener lis @Override protected void performDelete() throws IOException, InterruptedException { // prevent a new build while a delete operation is in progress - makeDisabled(true); + if (supportsMakeDisabled()) { + setDisabled(true); + Jenkins.get().getQueue().cancel(this); + } FilePath ws = getWorkspace(); if (ws != null) { Node on = getLastBuiltOn();