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

Logs incorrect when invoking multiple batch tasks after build

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • batch-task-plugin
    • None
    • Platform: All, OS: All

      First, thanks for creating the batch-task plugin. We have a lots of production
      and QA servers, and using it for deployment is huge for us!

      We use batch tasks to push product artifacts to several groups of servers. Thus,
      we commonly have several batch tasks configured for a project.

      When we run an automated nightly build, we use the "Invoke Batch Tasks of Other
      Projects" selection to kick off batch tasks after the build completes.

      With one selection things work fine. However, when we scheduled three items to
      run, things did not work correctly.

      Steps to reproduce:

      • configure a project with several batch tasks
      • configure the project to build on a schedule,
      • configure the project to "invoke batch tasks of other projects", and then
        use "add task" to invoke all three batch tasks

      Observed behavior:

      • when the project builds, it invokes all three batch tasks, according to the
        hudson log. In particular, ours looks like this:

      Total time: 6 minutes 47 seconds
      [locks-and-latches] Releasing all the locks
      [locks-and-latches] All the locks released
      Invoking CoLinx-WMS - CTNQA Everything #14-0
      Invoking CoLinx-WMS - CNVQA Everything #14-0
      Invoking CoLinx-WMS - CONQA Everything #14-0

      • We observed that the tasks all actually ran-- the problems is in display of
        the resulting logs
      • Observe that the numbers for the batch task number are not correct in the
        above log, all ending in "0"
      • We also observed that after the build, we see three links called "Executed
        TAsks" on the left nav bar of the project, instead of just one. clicking on any
        of the three links showed one task, intead of three. the link for each one
        appeared to be correct: http://hornet:8080/hudson/job/Colinx-WMS/14/batchTasks/
      • In the jobs folder, there was only one log file, not three, and it was
        titled "task-1.log".

      Expected Behavior:

      • one executed tasks link exists, and it links to a display showing three
        batch tasks, each with an available log on that page, and each with a task-#.log
        file in the jobs folder presumably.

      Thanks-- please do not hesitate to ask if I can clarify further

          [JENKINS-3133] Logs incorrect when invoking multiple batch tasks after build

          dcowden created issue -

          dcowden added a comment -

          Created an attachment (id=573)
          A screenshot of the multiple executed tasks links

          dcowden added a comment - Created an attachment (id=573) A screenshot of the multiple executed tasks links

          dcowden added a comment -

          Created an attachment (id=574)
          screenshot of the console showing files for this build ( number 14 )

          dcowden added a comment - Created an attachment (id=574) screenshot of the console showing files for this build ( number 14 )

          Alan Harder added a comment -

          I fixed the #0 thing a while back so it shows #1 now.. however, it still doesn't work when multiple tasks are invoked for the same job. I my test I saw #1-1 3 times; I'll work on fixing that.
          The multiple "Executed Tasks" thing must have been fixed at some point.. I got all 3 tasks under one "Executed Tasks" page.

          Alan Harder added a comment - I fixed the #0 thing a while back so it shows #1 now.. however, it still doesn't work when multiple tasks are invoked for the same job. I my test I saw #1-1 3 times; I'll work on fixing that. The multiple "Executed Tasks" thing must have been fixed at some point.. I got all 3 tasks under one "Executed Tasks" page.
          Alan Harder made changes -
          Assignee Original: Kohsuke Kawaguchi [ kohsuke ] New: Alan Harder [ mindless ]
          Alan Harder made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]

          Alan Harder added a comment -

          actually, it may have been luck that I got just one "Executed Tasks".. I'll add some synchronization to ensure duplicates aren't created when several tasks run about the same time.

          Alan Harder added a comment - actually, it may have been luck that I got just one "Executed Tasks".. I'll add some synchronization to ensure duplicates aren't created when several tasks run about the same time.

          Code changed in hudson
          User: : mindless
          Path:
          trunk/hudson/plugins/batch-task/src/main/java/hudson/plugins/batch_task/BatchRunAction.java
          trunk/hudson/plugins/batch-task/src/main/java/hudson/plugins/batch_task/BatchTask.java
          trunk/hudson/plugins/batch-task/src/main/java/hudson/plugins/batch_task/BatchTaskInvoker.java
          trunk/hudson/plugins/batch-task/src/main/resources/hudson/plugins/batch_task/Messages.properties
          trunk/hudson/plugins/batch-task/src/main/resources/hudson/plugins/batch_task/Messages_ja.properties
          http://fisheye4.cenqua.com/changelog/hudson/?cs=24464
          Log:
          [FIXED JENKINS-3133]

          • When invoking tasks from BatchTaskInvoker, only report nextBuildNumber once per project,
            to avoid incorrect repeated values.
          • Added synchronization to ensure only one BatchRunAction is added to run.
          • Removed "of other projects" from display name, as it is ok to use tasks of this project.
          • Fix log msg when task isn't found so it doesn't put "null" in the msg.

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : mindless Path: trunk/hudson/plugins/batch-task/src/main/java/hudson/plugins/batch_task/BatchRunAction.java trunk/hudson/plugins/batch-task/src/main/java/hudson/plugins/batch_task/BatchTask.java trunk/hudson/plugins/batch-task/src/main/java/hudson/plugins/batch_task/BatchTaskInvoker.java trunk/hudson/plugins/batch-task/src/main/resources/hudson/plugins/batch_task/Messages.properties trunk/hudson/plugins/batch-task/src/main/resources/hudson/plugins/batch_task/Messages_ja.properties http://fisheye4.cenqua.com/changelog/hudson/?cs=24464 Log: [FIXED JENKINS-3133] When invoking tasks from BatchTaskInvoker, only report nextBuildNumber once per project, to avoid incorrect repeated values. Added synchronization to ensure only one BatchRunAction is added to run. Removed "of other projects" from display name, as it is ok to use tasks of this project. Fix log msg when task isn't found so it doesn't put "null" in the msg.
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Resolved [ 5 ]
          Andrew Bayer made changes -
          Status Original: Resolved [ 5 ] New: Closed [ 6 ]

            mindless Alan Harder
            dcowden dcowden
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: