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

No timeout set on HttpClient #62

Open
zjfroot opened this issue Jun 11, 2014 · 2 comments
Open

No timeout set on HttpClient #62

zjfroot opened this issue Jun 11, 2014 · 2 comments

Comments

@zjfroot
Copy link

zjfroot commented Jun 11, 2014

At https://github.com/jlewallen/jenkins-hipchat-plugin/blob/master/src/main/java/jenkins/plugins/hipchat/StandardHipChatService.java#L60

When constructing HttpClient, there is no timeout set. We have experienced in several cases our Jenkins jobs stuck for hours even days on sending notification to HipChat. Here is an example thread dump:

Executor #3 for osx-slave2 : executing Core OS X #676

"Executor #3 for osx-slave2 : executing Core OS X #676" Id=149307 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.readV3Record(InputRecord.java:554)
    at sun.security.ssl.InputRecord.read(InputRecord.java:509)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:927)
    -  locked java.lang.Object@702cf130
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312)
    -  locked java.lang.Object@168ebfd9
    at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:702)
    at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:122)
    -  locked sun.security.ssl.AppOutputStream@15c5fd5a
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    -  locked java.io.BufferedOutputStream@46e3166f
    at org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:506)
    at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2114)
    at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096)
    at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
    at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
    at jenkins.plugins.hipchat.StandardHipChatService.publish(StandardHipChatService.java:43)
    at jenkins.plugins.hipchat.ActiveNotifier.completed(ActiveNotifier.java:63)
    at jenkins.plugins.hipchat.HipChatListener.onCompleted(HipChatListener.java:26)
    at jenkins.plugins.hipchat.HipChatListener.onCompleted(HipChatListener.java:14)
    at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:199)
    at hudson.model.Run.execute(Run.java:1727)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:231)

Though the thread has state "RUNNABLE" but it is in a native method that does the network operation. When it hangs, java thread still show as "RUNNABLE"

Without the timeout set, the operation will wait forever I believe.

@zjfroot
Copy link
Author

zjfroot commented Jun 11, 2014

One comment, the thread dump is from version 0.1.4

@warmfusion
Copy link

I have observed this issue, which requires a full jenkins master restart to resolve and as any indication of message sending is after the message is sent there was no clue as to why my builds stalled.

warmfusion pushed a commit to warmfusion/jenkins-hipchat-plugin that referenced this issue Aug 14, 2014
…meout to the HTTP Client connection so that it doesn't stall builds in the event of a network issue.
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