-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
sometimes I call AsyncHttpClient.execute but no response on the handler #48
Comments
Sound likes an issue. Can you add in your code a Thread.dumpStack inside the "if (!channel.isOpen() || !channel.isConnected())" and paste it here when the issue occurs? Thanks! |
sure. 02-10 17:50:34.644: W/System.err(24665): java.lang.Throwable: stack dump |
Ok lost track of that issue and doesn't have the env. to test. Can you attach a diff of your patch that works? Thanks! |
My ning version is 1.6.5. here's several lines in this method protected final void writeRequest(final Channel channel, |
From what I've tested, The diff I made seems to work correctly in kinds of network environment. |
The fix make sense, but I'm nerveous to put it in 1.7.3. I will cut 1.7.3 and then add it so it is included in 1.8.0. Would that works? |
Sure. |
Any updates? We're sometimes experiencing issues very similar to this (no handler methods called, but no exceptions or anything) and master branch doesn't include the fix. |
@technocoreai I need a test case to reproduce. Do you have one you can share? |
I'll see what I can do. It's very hard to produce on demand (it usually breaks after several hours of polling every 5-10 seconds), but one httpd/polling frequency makes it occur much more often than the rest, so I'll try building a test case out of it. |
Able to reproduce this with load test. Put this test into async-http-client-netty-provider test directory: And run this server on 50051 and 50056 ports: Test description : test makes 1000 http request with uuid in each. If we use setAllowPoolingConnection(true). , number of responses are missed : 2013-06-03 16:54:48,504 [Timer-1] ERROR org.asynchttpclient.NngMissedResponsesTest - Http requests statistics without caching setAllowPoolingConnection(false). all works : 2013-06-03 17:24:46,884 [Timer-0] ERROR org.asynchttpclient.NngMissedResponsesTest - Http requests statistics With described exception from NettyAsyncHttpProvider and setAllowPoolingConnection(true). all works too : 2013-06-03 16:59:13,221 [Timer-1] ERROR org.asynchttpclient.NngMissedResponsesTest - Http requests statistics |
That's something I planned on investigating someday... Just busy with Parts at the moment... |
Looks like a duplicate of #415 |
I've post this problem on https://issues.sonatype.org/browse/AHC-120. Since no comments there I want to ask for help here.
I'm working on Android platform and I try to use this http client. The detail about this problem is below. I wonder if it is only exposed on Android.
I do sth like:
m_asyncHttpClient.prepareGet(http_url).setPerRequestConfig(request_config) .setHeader("Connection", "Keep-Alive")
.setHeader("Accept-Language" , ...)
.execute(...)
with a AsyncHandler given as param.
If I do the above repeatly (several times) within a connected network situation, and a few times afterwards within a connected-less (no cable is connected) situation, then there's no callback function triggered.
I trace to the code and found that NettyAsyncHttpProvider's doConnect will create or get a future with a NettyConnectListener, whose operationComplete is called and "if (f.isSuccess())" is true, then "future.provider().writeRequest" is called.
in NettyAsyncHttpProvider's writeRequest,
"if (!channel.isOpen() || !channel.isConnected())" returns true, so it returns and no handler callback is triggered.
I use a ning of version 1.6.5. is it a known issue?
The text was updated successfully, but these errors were encountered: