-
Notifications
You must be signed in to change notification settings - Fork 594
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
Cannot pull port (requestParsingIn) twice #516
Comments
(Note: The output from below indicates that the akka version here is 2.4.10, which should be ignored... this is a build of akka-http from my machine because I needed the multipart charset fix) I have more information for this (@rgmccaw and I are working on this together). This appears to happen when the server for which we're proxying returns a The log shows
The curl output shows:
Perhaps the server for which we're proxying is reading the body of the POST or the |
I think it's simpler than I stated. I've created a clean room reproduction at https://github.com/derekwyatt/redirect-and-continue. Unfortunately, it doesn't illustrate the I invite @rgmccaw to try and enhance this little example with some more guts that can reproduce the final problem. |
I've made a patch to my local version of |
- Introduces a new configuration `akka.http.server.proxy-mode` - When `proxy-mode` is `on` the special handling of the `Expect: 100-Continue` behaviour will be disabled. - This alleviates the problem illustrated by https://github.com/derekwyatt/redirect-and-continue
Probably a duplicate of #448. Could you try if changing this line in if (!isClosed(requestParsingIn) && close && requestStart.expect100Continue) pull(requestParsingIn) to if (!isClosed(requestParsingIn) && close && requestStart.expect100Continue && !hasBeenPulled(requestParsingIn)) pull(requestParsingIn) would fix that issue? |
The inverse problem shows up:
|
Further analysis: this happens for 100-continue requests when you send out a response before the request entity has been read. |
…gIn-twice =htc #516 fix pull/push twice in server ControllerStage
I tried V10.0.4. Looks the problem does not fix. In my env, when the connection idles about some minutes, the error will occur. And if I connect again, it will become okey. BTW, this error occurs on HTTP, rarely see it on HTTPS. |
HI @Birdflying1005 can you post the exact error you get? Multiple issues were reported in this ticket and line numbers etc have changed so it's important we got the stack trace. |
@jrudolph sure. I am using akka-http as the http client to send the request to the REST API which is just like a API gateway.
In this code snippet , "pool" is a http connection pool which has cached the http connection.
And the setting is:
The error is:
And the error I do not know how to catch it in my code. please also guide me. Thanks. |
@Birdflying1005 This is a different bug, fortunately. I created #938 to track it. |
I'm using Akka HTTP (3.0.0-RC1) and I am getting an Exception in certain cases.
I can reproduce it by sending my application a request through a Burp Suite proxy. Below are three curl requests; two which do not cause the exception and one that does.
For the following CURLs the following is true:
test
is an empty file127.0.0.1:8282
localhost:9090
POST directly to the application
POST through Burp Suite then to the application
Note the addition of
Connection: close
and the conversion of the entity from a stream to a strict.POST with
Expect: 100-Continue
header removed, through Burp Suite then to the applicationPossibly related to #514 as this exception is also seen in production immediately after the 2xx message reported there. It may also be related to akka/akka#21008.
The text was updated successfully, but these errors were encountered: