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

Cron thread can get stuck making a connection

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Polling an HTTPS URL for changes can cause the entire cron thread to get stuck during a connection attempt. Here is a thread dump of a cron thread that was stuck for more than 5 hours (and likely to be stuck indefinitely):

      "Jenkins cron thread" Id=22 Group=main RUNNABLE (in native)
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:146)
      at sun.security.ssl.InputRecord.readFully(InputRecord.java:312)
      at sun.security.ssl.InputRecord.readV3Record(InputRecord.java:424)
      at sun.security.ssl.InputRecord.read(InputRecord.java:379)
      at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:850)

      • locked java.lang.Object@2213b7b7
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1190)
      • locked java.lang.Object@3c8260db
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1217)
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1201)
        at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:440)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1139)
      • locked sun.net.www.protocol.https.DelegateHttpsURLConnection@2fb65e1d
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
      • locked sun.net.www.protocol.https.HttpsURLConnectionImpl@43998053
        at java.net.URL.openStream(URL.java:1029)
        at com.redfin.hudson.UrlChangeTrigger.run(UrlChangeTrigger.java:63)
        at hudson.triggers.Trigger.checkTriggers(Trigger.java:250)
        at hudson.triggers.Trigger$Cron.doRun(Trigger.java:198)
        at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:54)
        at java.util.TimerThread.mainLoop(Timer.java:534)
        at java.util.TimerThread.run(Timer.java:484)

        Attachments

          Activity

          Hide
          corvus James Blair added a comment -

          Here's the thread dump for the whole system (which may be more readable):

          http://paste.openstack.org/show/4748/

          Show
          corvus James Blair added a comment - Here's the thread dump for the whole system (which may be more readable): http://paste.openstack.org/show/4748/
          Hide
          corvus James Blair added a comment -

          It appears we're using the deprecated url-change-trigger, however it looks like urltrigger would also be susceptible to the same problem.

          Show
          corvus James Blair added a comment - It appears we're using the deprecated url-change-trigger, however it looks like urltrigger would also be susceptible to the same problem.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Monty Taylor
          Path:
          src/main/java/org/jenkinsci/plugins/urltrigger/URLTrigger.java
          http://jenkins-ci.org/commit/urltrigger-plugin/d2a447a4ea4aad880493e5efb60f297ec2033f94
          Log:
          Fix JENKINS-12696

          Add a timeout to the network activity.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Monty Taylor Path: src/main/java/org/jenkinsci/plugins/urltrigger/URLTrigger.java http://jenkins-ci.org/commit/urltrigger-plugin/d2a447a4ea4aad880493e5efb60f297ec2033f94 Log: Fix JENKINS-12696 Add a timeout to the network activity.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          src/main/java/org/jenkinsci/plugins/urltrigger/URLTrigger.java
          http://jenkins-ci.org/commit/urltrigger-plugin/0681284704753132857a7daf476a02a16fc1f4be
          Log:
          Merge pull request #1 from emonty/master

          [FIXED JENKINS-12696]

          Looks good to me.

          Compare: https://github.com/jenkinsci/urltrigger-plugin/compare/b862ef3...0681284

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: src/main/java/org/jenkinsci/plugins/urltrigger/URLTrigger.java http://jenkins-ci.org/commit/urltrigger-plugin/0681284704753132857a7daf476a02a16fc1f4be Log: Merge pull request #1 from emonty/master [FIXED JENKINS-12696] Looks good to me. Compare: https://github.com/jenkinsci/urltrigger-plugin/compare/b862ef3...0681284

            People

            Assignee:
            dfabulich dfabulich
            Reporter:
            corvus James Blair
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: