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

Jenkins executors hang BLOCKED on hudson.plugins.xvnc.Xvnc$DescriptorImpl


    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • xvnc-plugin
    • None

      There's some kind of thread locking issue that is causing our builds to hang while either claiming or freeing xvnc resources, resulting in the following thread state:

      {{Executor #4 for ubuntu-bach : executing gerrit-connector-tck/A=JIRA_6.0.8,ENV=gtk.x86_64.tck #2733" Id=22583 Group=main BLOCKED on hudson.plugins.xvnc.Xvnc$DescriptorImpl@5665db5b owned by "Executor #7 for ubuntu-bartok : executing gerrit-connector-tck/A=Bugzilla_4.4.1,ENV=gtk.x86_64.tck #2733" Id=22146
      at hudson.plugins.xvnc.Xvnc.getAllocator(Xvnc.java:257)

      • blocked on hudson.plugins.xvnc.Xvnc$DescriptorImpl@5665db5b
        at hudson.plugins.xvnc.Xvnc.access$000(Xvnc.java:47)
        at hudson.plugins.xvnc.Xvnc$DisposerImpl.tearDown(Xvnc.java:244)
        at jenkins.tasks.SimpleBuildWrapper$EnvironmentWrapper.tearDown(SimpleBuildWrapper.java:174)
        at hudson.model.Build$BuildExecution.doRun(Build.java:173)
        at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
        at hudson.model.Run.execute(Run.java:1741)
        at hudson.matrix.MatrixRun.run(MatrixRun.java:146)
        at hudson.model.ResourceController.execute(ResourceController.java:98)
        at hudson.model.Executor.run(Executor.java:410)}}

      We're pretty sure the issue is caused when our matrix builds are being aborted. The following code has been identified as "suspicious looking" –

      1. xvnc-plugin/src/main/java/hudson/plugins/xvnc/DisplayAllocator.java:47

      public int allocate(final int minDisplayNumber, final int maxDisplayNumber) {

      { return doAllocate(minDisplayNumber, maxDisplayNumber); }


      { save(); }


      Notice that with this code, the save() method will be called before the doAllocate method. It would seem it was the author's intention to allocate the display first, and then finally save; but that's not what this code will do. Once the return statement has been reached in the try-block (as in, just before returning anything) the save() method will be called. Then the return statement will execute, which will at that time perform the allocation.

      This is something that occurs rather regularly in our environment, and is a big pain for developers who are trying to run their tests.

            levsa Levon Saldamli
            rootd00d Casey Billett
            1 Vote for this issue
            4 Start watching this issue