Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub.getRateLimit hangs inside SocketInputStream.socketRead0 #271

Closed
kiselev-dv opened this issue Apr 11, 2016 · 1 comment
Closed

GitHub.getRateLimit hangs inside SocketInputStream.socketRead0 #271

kiselev-dv opened this issue Apr 11, 2016 · 1 comment

Comments

@kiselev-dv
Copy link

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.

@kohsuke
Copy link
Collaborator

kohsuke commented Jun 3, 2016

Starting 1.71 we already set timeout by default. See ImpatientHttpConnector and HttpConnector.DEFAULT.

I assume you were using an older version.

@kohsuke kohsuke closed this as completed Jun 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants