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

neverending connection on pull #82

Open
jwierzbo opened this issue Jun 8, 2015 · 2 comments
Open

neverending connection on pull #82

jwierzbo opened this issue Jun 8, 2015 · 2 comments

Comments

@jwierzbo
Copy link

jwierzbo commented Jun 8, 2015

Took me a lot of time to tracked this bug. Here we go:

I used threads to pull from specific queue and all the time, after some random time, my pullers stopped working accidentally. I thought that was the problem with pool thread in Java, but I was wrong. In thread dump I've seen that all my pulling-threads are stuck in same line of code - IronMqJava library Client.java:

int status = conn.getResponseCode();

In above code we make request to ironMq server, but we haven't set timeout param which by default is 0 - inifinty. So if an error happen on IronMq server our code is waiting for the response forever!

That's why I added following lines:

conn.setConnectTimeout(this.httpTimeout);
conn.setReadTimeout(this.httpTimeout);

After this now I get familiar error:

 java.net.SocketTimeoutException: Read timed out
    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:934)
    at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:891)
    at sun.security.ssl.AppInputStream.read(AppInputStream.java:102)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
    at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
    at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:689)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:633)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1324)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
    at io.iron.ironmq.Client.singleRequest(Client.java:255)
    at io.iron.ironmq.Client.request(Client.java:204)
    at io.iron.ironmq.Client.post(Client.java:185)
    at io.iron.ironmq.Queue.reserve(Queue.java:148)

I'm using forked code so I couldn't prepare fix straight.

@pax95
Copy link
Contributor

pax95 commented Jun 15, 2015

Why has there not been any progress/response on this bug ?

@jwierzbo
Copy link
Author

BTW above issue refers to IronMq V3 - I haven't check it with V1

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