We've run into an issue when GitHub.getRateLimit hangs the thread.
Here is the thread stack trace:
"jenkins.util.Timer [#4]" Id=48 Group=main RUNNABLE (in native)
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:152)
at java.net.SocketInputStream.read(SocketInputStream.java:122)
at sun.security.ssl.InputRecord.readFully(InputRecord.java:442)
at sun.security.ssl.InputRecord.read(InputRecord.java:480)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:946)
- locked java.lang.Object@4be77f76
at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:903)
at sun.security.ssl.AppInputStream.read(AppInputStream.java:102)
- locked sun.security.ssl.AppInputStream@5e6fb401
at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
- locked java.io.BufferedInputStream@7792de16
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:690)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:633)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1325)
- locked sun.net.www.protocol.https.DelegateHttpsURLConnection@6db28b13
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
at org.kohsuke.github.Requester.parse(Requester.java:454)
at org.kohsuke.github.Requester._to(Requester.java:227)
at org.kohsuke.github.Requester.to(Requester.java:194)
at org.kohsuke.github.GitHub.getRateLimit(GitHub.java:245)
at org.jenkinsci.plugins.ghprb.GhprbRepository.initGhRepository(GhprbRepository.java:66)
at org.jenkinsci.plugins.ghprb.GhprbRepository.check(GhprbRepository.java:88)
at org.jenkinsci.plugins.ghprb.Ghprb.run(Ghprb.java:119)
at org.jenkinsci.plugins.ghprb.GhprbTrigger.run(GhprbTrigger.java:219)
at hudson.triggers.Trigger.checkTriggers(Trigger.java:272)
at hudson.triggers.Trigger$Cron.doRun(Trigger.java:221)
at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:50)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Number of locked synchronizers = 1
- java.util.concurrent.ThreadPoolExecutor$Worker@6b1824c6
There is a possibility that https://github.com/kohsuke/github-api/blob/master/src/main/java/org/kohsuke/github/Requester.java#L486 will never return an aswer.
I think, uc.setTimeout(60 * 1000); here https://github.com/kohsuke/github-api/blob/master/src/main/java/org/kohsuke/github/Requester.java#L453 should fix the problem.
We've run into an issue when GitHub.getRateLimit hangs the thread.
Here is the thread stack trace:
There is a possibility that https://github.com/kohsuke/github-api/blob/master/src/main/java/org/kohsuke/github/Requester.java#L486 will never return an aswer.
I think,
uc.setTimeout(60 * 1000);here https://github.com/kohsuke/github-api/blob/master/src/main/java/org/kohsuke/github/Requester.java#L453 should fix the problem.