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

Agent websocket sessions not cleared up on connection close

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • 2.379

      When there is a problem right after the agent establishes the websocket connection to the controller, the websocket session is not cleared up from the controller, which eventually end up filling up controller memory.

      Even if sessions are stored in the WeakHashMap, the GC is not able to collect entries because there is a reference loop between sessions (values in the map) and listeners (keys in the map).

      This issue is specially problematic when migrating from a Jenkins instance running on Java 8 to run on Java 11, while some agents might still be running on 8, so they fail to connect, as expected, not an issue, but meanwhile they bring the Jenkins instance down by consuming all the available memory.

          [JENKINS-70103] Agent websocket sessions not cleared up on connection close

          Antonio Muñiz created issue -
          Antonio Muñiz made changes -
          Assignee New: Antonio Muñiz [ amuniz ]
          Antonio Muñiz made changes -
          Remote Link New: This issue links to "PR (Web Link)" [ 28354 ]
          Antonio Muñiz made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Antonio Muñiz made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Jesse Glick made changes -
          Assignee Original: Antonio Muñiz [ amuniz ] New: Jesse Glick [ jglick ]
          Jesse Glick made changes -
          Labels New: lts-candidate
          Jesse Glick made changes -
          Remote Link New: This issue links to "jenkins #7412 (Web Link)" [ 28356 ]
          Basil Crow made changes -
          Released As New: 2.379
          Resolution New: Fixed [ 1 ]
          Status Original: In Review [ 10005 ] New: Fixed but Unreleased [ 10203 ]
          Alexander Brandes made changes -
          Status Original: Fixed but Unreleased [ 10203 ] New: Closed [ 6 ]

            jglick Jesse Glick
            amuniz Antonio Muñiz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: