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

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

XMLWordPrintable

    • 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:

      http://www.nabble.com/Possible-memory-leak-in-hudson.remoting.ExportTable-td12000299.html

      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
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: