Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-14227

Thread count increases linearly with scheduled task execution

    XMLWordPrintable

    Details

    • Story Points:
      2
    • Sprint:
      Core Sprint 103

      Description

      Starting with 3.5.0, a new thread appears to be created each time a scheduled task executes, but is left in the WAITING state at the conclusion of the task. The overall thread count for the Nexus process increases indefinitely until the max user processes limit is reached (ulimit -u). Once this occurs, Nexus becomes mostly unresponsive.

      The behavior was first observed in a regular installation of 3.5.0 on RHEL 6, where the default ulimit -u was set to 1024. Increasing the "max user processes" limit extends the time before restarting the Nexus process is required.

      The issue of threads linearly increasing was reproduced using the sonatype/nexus3 Docker image on a macOS host using the following steps:

      1. Create and run Nexus in new Docker container with defaults:
        docker run -d -p 8081:8081 --name nexus sonatype/nexus3:3.5.1
        
      1. Login as admin, navigate to "Metrics", download "Thread dump" (result attached: 01-threads-start.txt)
      2. Create scheduled task, select "Advanced" for "Task frequency", and provide "* * * * * ?" for cron expression to run every second.
      3. Wait 30 minutes (approx. 1800 tasks run, 1800+ threads).
      4. Navigate to "Metrics", download "Thread dump" (result attached: 02-threads-1800-tasks-run.txt)

      Thread count never exceeds 120 when following the same steps on released versions 3.3.0 - 3.4.1. 

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bradbeck Brad Beck
              Reporter:
              jjustinic James Justinic
              Last Updated By:
              Peter Lynch
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response:

                  tigCommentSecurity.panel-title