If a Matrix job has a 'weight' not equal to 1, it fails to start its children and just runs indefinitely. Also, it is shown as 'running' in Job view even after cancelling, which is fixed only by restarting Jenkins.
      I think there is a problem with starting FlyWightTask. Jenkins wait for thread in "offer.event.block();" (Queue.java::830 .Jenkins code). Executor #-1 seems to not release, as it should.

      FreeStyle projects starts normally even it's weight > 1.

          [JENKINS-11548] Heavy Job plugin not working with Matrix jobs

          Alex Vesely created issue -
          Ivan Vovk made changes -
          Description Original: If a Matrix job has a 'weight' not equal to 1, it fails to start its children and just runs indefinitely. Also, it is shown as 'running' in Job view even after cancelling, which is fixed only by restarting Jenkins. New: If a Matrix job has a 'weight' not equal to 1, it fails to start its children and just runs indefinitely. Also, it is shown as 'running' in Job view even after cancelling, which is fixed only by restarting Jenkins.
          I think there is a problem with starting FlyWightTask. Jenkins wait for thread in "offer.event.block();" (Queue.java::830 .Jenkins code). Executor #-1 seems to not release, as it should.

          FreeStyle projects starts normally even it's weight > 1.
          Labels New: heavy-job matrix
          Ivan Vovk made changes -
          Assignee New: Ivan Vovk [ ivovk ]
          Ivan Vovk made changes -
          Assignee Original: Ivan Vovk [ ivovk ] New: ittay [ ittay ]
          Ivan Vovk made changes -
          Assignee Original: ittay [ ittay ] New: Kohsuke Kawaguchi [ kohsuke ]

          Ivan Vovk added a comment -

          It seems to doesn't work with matrix job because when matrix job executing it doesn't do MappingWorksheet or smth similar for matrix job. Freestyle project executes MappingWorksheet function and this function allocates buildable jobs to executors as needed. For example, if (Queue.java:802) ws.works[0] contains two elements - "FreeStyleProject" and "HeavyJobProperty". It's recognized like two (sub?)tasks. These tasks is occupied by Executors #0 and #1. As a result whole process correctly executed. When our project is a matrix project with weight > 1 MappingWorksheet function doesn't executes.So, in this case our project isn't divided into two buildable (sub?)tasks and isn't executed correctly (isn't consumed by many executors).I can't figure out how matrix job manage queue. So I don't know how to make this plugin to work with matrix job.

          Ivan Vovk added a comment - It seems to doesn't work with matrix job because when matrix job executing it doesn't do MappingWorksheet or smth similar for matrix job. Freestyle project executes MappingWorksheet function and this function allocates buildable jobs to executors as needed. For example, if (Queue.java:802) ws.works [0] contains two elements - "FreeStyleProject" and "HeavyJobProperty". It's recognized like two (sub?)tasks. These tasks is occupied by Executors #0 and #1. As a result whole process correctly executed. When our project is a matrix project with weight > 1 MappingWorksheet function doesn't executes.So, in this case our project isn't divided into two buildable (sub?)tasks and isn't executed correctly (isn't consumed by many executors).I can't figure out how matrix job manage queue. So I don't know how to make this plugin to work with matrix job.
          Mikhail Churikov made changes -
          Assignee Original: Kohsuke Kawaguchi [ kohsuke ] New: Mikhail Churikov [ mvchurik ]

          Mikhail Churikov added a comment - - edited

          Ivan Vovk and I fixed the bug in our local version of Jenkins sources. In the case FLYWEIGHT_SUPPORT set true, Jenkins trys start second matrix parent executor on the stage MappingWorkSheet and goes to wait. That activity was blocked. In the opposite case, we block occupying executors by the matrix parent in the same way. We also pass HeavyJobProperty to trigered nodes.

          How cam we merge this fix with trunk? (I'm new to git workflow)
          May I commit to trunk or carry patch?

          Mikhail Churikov added a comment - - edited Ivan Vovk and I fixed the bug in our local version of Jenkins sources. In the case FLYWEIGHT_SUPPORT set true, Jenkins trys start second matrix parent executor on the stage MappingWorkSheet and goes to wait. That activity was blocked. In the opposite case, we block occupying executors by the matrix parent in the same way. We also pass HeavyJobProperty to trigered nodes. How cam we merge this fix with trunk? (I'm new to git workflow) May I commit to trunk or carry patch?

          Juri Timošin added a comment -

          Hello. Could you share the patch somehow? That would be very kind of you. We would like to start using this plugin with matrix jobs. Or may you can create a pull request in github? Thanks in advance.

          Juri Timošin added a comment - Hello. Could you share the patch somehow? That would be very kind of you. We would like to start using this plugin with matrix jobs. Or may you can create a pull request in github? Thanks in advance.

          This patch solves this bug, here is the github pull request https://github.com/jenkinsci/heavy-job-plugin/pull/1
          It would be great if it could be merged soon. Meanwhile, feel free to use the patch.
          Description: "This pull request implementes support for the matrix jobs in the heavy job plugin. This plugin now correctly handles the main FlyweightTask created by the MatrixProject and adds weight to all configuration-specific builds created by it."

          Cristian Zamfir added a comment - This patch solves this bug, here is the github pull request https://github.com/jenkinsci/heavy-job-plugin/pull/1 It would be great if it could be merged soon. Meanwhile, feel free to use the patch. Description: "This pull request implementes support for the matrix jobs in the heavy job plugin. This plugin now correctly handles the main FlyweightTask created by the MatrixProject and adds weight to all configuration-specific builds created by it."

            mvchurik Mikhail Churikov
            alex01ves Alex Vesely
            Votes:
            9 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated: