Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-21932

Job hangs if one of multiple triggered builds was aborted

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None

      I have two cases with job hanging:
      1) Parent job triggers multiple different jobs and waits for their completion. I abort some triggered job while it stays in queue. After that parent job never finished, waiting for completion.
      2) Parent job triggers multiple instances (via label factory) of one job on different slaves and waits for completion. I abort one of job while it executes on slave. Parent job hangs forever saying "Waiting for completion".

      I believe it worked correctly (in both cases parent job has failed) in some previous version.
      I've recently updated Jenkins from 1.48 to 1.532
      As well as Parametrized Trigger Plugin from 2.16 to 2.22
      And NodeLabel Parameter Plugin from 1.2.1 to 1.4

          [JENKINS-21932] Job hangs if one of multiple triggered builds was aborted

          ikedam added a comment -

          This seems introduced in 513a45b.
          The problem reproduces with that commit, but not with 7b2541d which is the parent of 513a45b.

          ikedam added a comment - This seems introduced in 513a45b . The problem reproduces with that commit, but not with 7b2541d which is the parent of 513a45b .

          ikedam added a comment -

          Jenkins <= 1.519 (7b2541d)

          • Queue#doCancelItem
            • Queue#cancel(Item)
              • Item#onCancelled
                • FutureImpl#setAsCancelled

          Jenkins >= 1.520 (513a45b)

          • Queue#doCancelItem
            • Queue#cancel(Item)
              • Item#leave
          • Item#onCancelled is removed in 513a45b.
          • I think it should work in following way:
            • Queue#doCancelItem
              • Queue#cancel(Item)
                • Item#cancel
                  • Item#leave
                  • FutureImpl#setAsCancelled

          ikedam added a comment - Jenkins <= 1.519 ( 7b2541d ) Queue#doCancelItem Queue#cancel(Item) Item#onCancelled FutureImpl#setAsCancelled Jenkins >= 1.520 ( 513a45b ) Queue#doCancelItem Queue#cancel(Item) Item#leave Item#onCancelled is removed in 513a45b . I think it should work in following way: Queue#doCancelItem Queue#cancel(Item) Item#cancel Item#leave FutureImpl#setAsCancelled

          Oleg Nenashev added a comment -

          I've discovered an issue in the remoting library, which may cause this issue.
          https://github.com/jenkinsci/remoting/pull/22

          Oleg Nenashev added a comment - I've discovered an issue in the remoting library, which may cause this issue. https://github.com/jenkinsci/remoting/pull/22

          ikedam added a comment -

          Posted pull request:
          https://github.com/jenkinsci/jenkins/pull/1160

          And changed component to core as this is fix for Jenkins core.

          ikedam added a comment - Posted pull request: https://github.com/jenkinsci/jenkins/pull/1160 And changed component to core as this is fix for Jenkins core.

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          src/main/java/hudson/remoting/AsyncFutureImpl.java
          http://jenkins-ci.org/commit/remoting/f32e434cb195e5d8d6d160f78116a053b948be62
          Log:
          Fixed the synchronization issue for cancel() operations

          Locking operations may affect hudson.remoting.Request::get() handlers
          The issue may cause the JENKINS-21932, which seems to be caused by unhandled locks().

          Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: src/main/java/hudson/remoting/AsyncFutureImpl.java http://jenkins-ci.org/commit/remoting/f32e434cb195e5d8d6d160f78116a053b948be62 Log: Fixed the synchronization issue for cancel() operations Locking operations may affect hudson.remoting.Request::get() handlers The issue may cause the JENKINS-21932 , which seems to be caused by unhandled locks(). Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>

          Code changed in jenkins
          User: ikedam
          Path:
          test/src/test/java/hudson/model/QueueTest.java
          http://jenkins-ci.org/commit/jenkins/35dfc75c682e1c7dbc1308426e1d75a0f18a2ab9
          Log:
          JENKINS-21932 Added tests to reproduce JENKINS-21932, Future#get does not abort even when a task in the queue is canceled.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: test/src/test/java/hudson/model/QueueTest.java http://jenkins-ci.org/commit/jenkins/35dfc75c682e1c7dbc1308426e1d75a0f18a2ab9 Log: JENKINS-21932 Added tests to reproduce JENKINS-21932 , Future#get does not abort even when a task in the queue is canceled.

          Code changed in jenkins
          User: ikedam
          Path:
          test/src/test/java/hudson/model/QueueTest.java
          http://jenkins-ci.org/commit/jenkins/5c3672270bcc97d5d05541f284c35b44067693ea
          Log:
          JENKINS-21932 Make the slave used in the test offline explicitly.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: test/src/test/java/hudson/model/QueueTest.java http://jenkins-ci.org/commit/jenkins/5c3672270bcc97d5d05541f284c35b44067693ea Log: JENKINS-21932 Make the slave used in the test offline explicitly.

          Code changed in jenkins
          User: ikedam
          Path:
          core/src/main/java/hudson/model/Queue.java
          http://jenkins-ci.org/commit/jenkins/0c3d67097a3394fee7f0eb895c4350ea96887a02
          Log:
          [FIXED JENKINS-21932] Call Item#cancel when a task in a queue is cancelled.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: core/src/main/java/hudson/model/Queue.java http://jenkins-ci.org/commit/jenkins/0c3d67097a3394fee7f0eb895c4350ea96887a02 Log: [FIXED JENKINS-21932] Call Item#cancel when a task in a queue is cancelled.

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          changelog.html
          core/src/main/java/hudson/model/Queue.java
          test/src/test/java/hudson/model/QueueTest.java
          http://jenkins-ci.org/commit/jenkins/fce4fed4e8785ebf2618e5532d1416488bb9fa6d
          Log:
          JENKINS-21932 Merge pull request #1160

          Compare: https://github.com/jenkinsci/jenkins/compare/eb0bfa5ece8e...fce4fed4e878

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html core/src/main/java/hudson/model/Queue.java test/src/test/java/hudson/model/QueueTest.java http://jenkins-ci.org/commit/jenkins/fce4fed4e8785ebf2618e5532d1416488bb9fa6d Log: JENKINS-21932 Merge pull request #1160 Compare: https://github.com/jenkinsci/jenkins/compare/eb0bfa5ece8e...fce4fed4e878

          dogfood added a comment -

          Integrated in jenkins_main_trunk #3303
          JENKINS-21932 Added tests to reproduce JENKINS-21932, Future#get does not abort even when a task in the queue is canceled. (Revision 35dfc75c682e1c7dbc1308426e1d75a0f18a2ab9)
          JENKINS-21932 Make the slave used in the test offline explicitly. (Revision 5c3672270bcc97d5d05541f284c35b44067693ea)
          [FIXED JENKINS-21932] Call Item#cancel when a task in a queue is cancelled. (Revision 0c3d67097a3394fee7f0eb895c4350ea96887a02)

          Result = SUCCESS
          devld : 35dfc75c682e1c7dbc1308426e1d75a0f18a2ab9
          Files :

          • test/src/test/java/hudson/model/QueueTest.java

          devld : 5c3672270bcc97d5d05541f284c35b44067693ea
          Files :

          • test/src/test/java/hudson/model/QueueTest.java

          devld : 0c3d67097a3394fee7f0eb895c4350ea96887a02
          Files :

          • core/src/main/java/hudson/model/Queue.java

          dogfood added a comment - Integrated in jenkins_main_trunk #3303 JENKINS-21932 Added tests to reproduce JENKINS-21932 , Future#get does not abort even when a task in the queue is canceled. (Revision 35dfc75c682e1c7dbc1308426e1d75a0f18a2ab9) JENKINS-21932 Make the slave used in the test offline explicitly. (Revision 5c3672270bcc97d5d05541f284c35b44067693ea) [FIXED JENKINS-21932] Call Item#cancel when a task in a queue is cancelled. (Revision 0c3d67097a3394fee7f0eb895c4350ea96887a02) Result = SUCCESS devld : 35dfc75c682e1c7dbc1308426e1d75a0f18a2ab9 Files : test/src/test/java/hudson/model/QueueTest.java devld : 5c3672270bcc97d5d05541f284c35b44067693ea Files : test/src/test/java/hudson/model/QueueTest.java devld : 0c3d67097a3394fee7f0eb895c4350ea96887a02 Files : core/src/main/java/hudson/model/Queue.java

            Unassigned Unassigned
            cerber Sergey Irisov
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: