• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • pagerduty-plugin
    • None

      When using the PagerDuty plugin within a pipeline with granularity set to 1 minute. We notice that the plugin will create threads in waiting state to the point of thread exhaustion.

      The majority of threads created had the following stacktrace

      Thread-308 - priority:5 - threadId:0x00007fdd8412b000 - nativeId:0x9f6 - state:TIMED_WAITING stackTrace: java.lang.Thread.State: TIMED_WAITING (on object monitor) at java.lang.Object.wait(Native Method) at com.mashape.unirest.http.utils.SyncIdleConnectionMonitorThread.run(SyncIdleConnectionMonitorThread.java:22) - locked <0x00000003df659280> (a com.mashape.unirest.http.utils.SyncIdleConnectionMonitorThread)
      

       This maybe related to https://github.com/Kong/unirest-java/issues/148

      Thread counts with without plugin enabled

          [JENKINS-53214] PagerDuty plugin thread leak

          Stefan C added a comment -

          I have had this same issue for quite a while and only recently came across this.

           

          "Thread-1087" #61197 daemon prio=5 os_prio=0 tid=0x00007f508c7f9800 nid=0x24b in Object.wait() [0x00007f500ad30000]"Thread-1087" #61197 daemon prio=5 os_prio=0 tid=0x00007f508c7f9800 nid=0x24b in Object.wait() [0x00007f500ad30000]   java.lang.Thread.State: TIMED_WAITING (on object monitor) at java.lang.Object.wait(Native Method) at com.mashape.unirest.http.utils.SyncIdleConnectionMonitorThread.run(SyncIdleConnectionMonitorThread.java:22) - locked <0x00000006cfd075c0> (a com.mashape.unirest.http.utils.SyncIdleConnectionMonitorThread)

           

          Jenkins version 2.170

          PagerDuty plugin 0.4.1

          Ubuntu 18.04.2

          openjdk version "1.8.0_191"
          OpenJDK Runtime Environment (build 1.8.0_191-8u191-b12-2ubuntu0.18.04.1-b12)
          OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)

           

          Stefan C added a comment - I have had this same issue for quite a while and only recently came across this.   " Thread -1087" #61197 daemon prio=5 os_prio=0 tid=0x00007f508c7f9800 nid=0x24b in Object .wait() [0x00007f500ad30000] " Thread -1087" #61197 daemon prio=5 os_prio=0 tid=0x00007f508c7f9800 nid=0x24b in Object .wait() [0x00007f500ad30000]   java.lang. Thread .State: TIMED_WAITING (on object monitor) at java.lang. Object .wait(Native Method) at com.mashape.unirest.http.utils.SyncIdleConnectionMonitorThread.run(SyncIdleConnectionMonitorThread.java:22) - locked <0x00000006cfd075c0> (a com.mashape.unirest.http.utils.SyncIdleConnectionMonitorThread)   Jenkins version 2.170 PagerDuty plugin 0.4.1 Ubuntu 18.04.2 openjdk version "1.8.0_191" OpenJDK Runtime Environment (build 1.8.0_191-8u191-b12-2ubuntu0.18.04.1-b12) OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)  

          We're experiencing the same issue.

          It's coming from Unirest like mentioned in the description.

          I'll add, as a precision, that the issue resides in the pagerduty-client library. See https://github.com/dikhan/pagerduty-client/issues/26

          Louis-Rémi Paquet added a comment - We're experiencing the same issue. It's coming from Unirest like mentioned in the description. I'll add, as a precision, that the issue resides in the pagerduty-client library. See https://github.com/dikhan/pagerduty-client/issues/26

            alexanderlz Alexander Leibzon
            daxroc Damien Roche
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: