SonarQube Enterprise Edition Version 7.9.6 (build 41879)
Jenkins is searching all branches analysis using OkHttp thread and in case the analysis was canceled on Sonarqube, the thread remain into the pool for 5 minutes. Repeating this we reach the 500 limit threads of Jenkins after the Jenkins cannot initialize new thread
steps to reproduce
Jenkins process a feature branch and do an analysis with sonarqube.
Analysis is OK and published in sonarqube
After a while (Key: sonar.dbcleaner.daysBeforeDeletingInactiveShortLivingBranches) the analysis is canceled.
The web page of the organization and project in Jenkins is searching all information’s about each branches, including the old branches where the analysis has been deleted.
The OkHttp thread used remain active for 5 minutes.
Repeating the reload of the web page increase the number of Okhttp thread and reaches 500 threads
At that point Jenkins is not able to initialize new thread and is stuck
We found this problem when many people was loading the web page of the projects during a consolidation release. People was checking the progress of the pipeline in jenkins and suddenly the Jenkins was crashing.
As remediation in short term, we have reduced the number of old project by filtering it from Jenkins, but we cannot guarantee a stable situation for ever.