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

Sonarqube Threads TIMED_WAITING

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • sonar-plugin
    • Jenkins version: 2.332.2-lts-jdk11
      SonarQube Scanner plugin version: 2.14
      Java version: 11

      Sonarqube has a retention policy that removes jobs that are inactive for this configured time. While using Sonarqube's plugin on Jenkins, when we access a project/build, this will create a thread asking for the status of the quality gate as shown in the image below. If the scan no longer exists due to sonar's retention policy, this thread will hang on TIMED_WAITING status and keep on there for long (I don't know how much time but long enough to give us some serious issues). If we keep a browser tab opened on that project (we are a +1000 engineers company), this will keep creating thousands of threads in a matter of minutes that will stack until the VM instance starts to kill all threads (including important threads to maintain Jenkins working properly, like the thread listening on the Jenkins agents port). The way that we figured out to mitigate this issue was to kill the Jenkins actions on older jobs (older than the retention policy on Sonar) so it will not create more requests. We identified this while watching a lot of Sonarqube HTTPOK threads and on Jenkins Logs we got a lot of errors saying that the task ID didn't exist:

       

      Error 404 on https://sonarqube-xxxxxx.xxxxxx.xxxxxx.com//api/ce/task?id=XXXXXXXXXXX : {"errors":[
      {"msg":"No activity found for task 'XXXXXXXXXXX'"}
      ]}
      

       

            sonarteam Sonar Team
            luiscarvalho_td Luis Carvalho
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: