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

hudson.remoting.Channel.unexport attempts to unexport oid instead of object


    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • core
    • None
    • Platform: All, OS: All

      We came across an issue where we were seeing persistent memory leaks in Hudson.
      It appeared to be similar if not the same as the latter part of this thread:


      It was extremely subtle to track this thing down, but I've found the cause of it.

      It looks like in the course of handling Unexport and EOF commands, Hudson calls
      hudson.remoting.Channel.unexport(oid). This in turn calls
      hudson.remoting.ExportTable.unexport(oid), but unfortunately the latter method
      expects to be passed the exported object itself, not the oid. It dutifully looks
      to see if anyone has exported the Integer oid and when it finds nobody has, it
      returns without releasing the reference from the intended Entry.

      The fix is simple; introduce an unexportByOid method onto
      hudson.remoting.ExportTable and have hudson.remoting.Channel call that instead.
      Patch forthcoming.

            Unassigned Unassigned
            md5 Mike Dillon
            0 Vote for this issue
            1 Start watching this issue