示例#1
0
文件: Job.java 项目: neo2buha/jenkins
 @Override
 protected void performDelete() throws IOException, InterruptedException {
   // if a build is in progress. Cancel it.
   RunT lb = getLastBuild();
   if (lb != null) {
     Executor e = lb.getExecutor();
     if (e != null) {
       e.interrupt();
       // should we block until the build is cancelled?
     }
   }
   super.performDelete();
 }
示例#2
0
    /**
     * Deletes this item.
     *
     * <p>
     * Any exception indicates the deletion has failed, but {@link AbortException} would prevent the caller
     * from showing the stack trace. This
     */
    public synchronized void delete() throws IOException, InterruptedException {
        checkPermission(DELETE);
        performDelete();

        // defer the notification to avoid the lock ordering problem. See JENKINS-19446.
        MasterComputer.threadPoolForRemoting.submit(new java.util.concurrent.Callable<Void>() {
            @Override
            public Void call() throws Exception {
                invokeOnDeleted();
                Jenkins.getInstance().rebuildDependencyGraphAsync();
                return null;
            }

            /**
             * A pointless function to work around what appears to be a HotSpot problem. See JENKINS-5756 and bug 6933067
             * on BugParade for more details.
             */
            private void invokeOnDeleted() throws IOException {
                getParent().onDeleted(AbstractItem.this);
            }
        });
    }