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

Jobs using docker agents disrupt each other if triggered simultaneously

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • docker-plugin, remoting
    • None
    • Docker 18.06.1-ce, MacOS and Linux
      Jenkins 2.141
      Docker plugin 1.1.5

      In a Jenkins environment which has one Docker agent template defined, create two simple Pipeline jobs which will both use that template. One job will run an 'echo' step and exit quickly, the other will sleep for 60 seconds. If you trigger these two jobs simultaneously, the short-running one will finish successfully and its container will then be stopped. When that happens, the remoting connection to the remaining job gets disrupted. It throws this exception in its console log:

      Cannot contact dockeragent-0002sinrcnyoa: hudson.remoting.ChannelClosedException: Channel "unknown": Remote call on dockeragent-0002sinrcnyoa failed. The channel is closing down or has closed down
      

      And at this point the job is hung and must be manually aborted. The workaround for this problem is either to put a five second sleep in between triggering the two jobs, or to create an additional Docker agent template with a different label, and configure each job to use a separate label.

      I'm not sure if the problem here is with the Docker plugin or with Remoting.

      Attached is a complete log from the Jenkins service, from the time the two jobs were triggered. The 'SEVERE: Error during callback' errors happened while the broken job was still trying to run before it was aborted.

            Unassigned Unassigned
            owenmehegan Owen Mehegan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: