-
Notifications
You must be signed in to change notification settings - Fork 192
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
HTTP manager shared state corruption when sending wrong length for stream #204
Comments
I haven't had a chance to try your example, but this behavior doesn't surprise me: the current code doesn't actually confirm that the caller is passing in valid parameters IIRC. Adding in such a check should not be too difficult, and would be in the |
Gotcha. One question though - exactly where the corruption might be occurring? It will be good to know. This issue makes the HTTP manager go in bad state, and reject all subsequent requests until it recovers. So, I have the same workaround of validating the length. Before I take a stab, would a solution like below be suitable for adaptation? Basically, we need to keep track of length in source stream, and return some kind of failure if length doesn't match the passed in parameter.
|
Yeah, something like that makes sense. It's not actually the manager itself that's getting corrupted, it's the connection to the server. It seems that the beginning of the next request is being treated as the end of the previous request body, causing the next request to be misinterpreted by the server. |
Thanks for explanation. I am going to take a stab at fixing this now. I have identified the code block to be fixed. Before I do a fix and PR, could someone please comment on length calculation in case Also, there is matter of what kind of error to raise here. Perhaps |
Looks like this was resolved by #205. |
Cross-post from SO where I asked about it.
Given a shared HTTP manager, it seems that if the requestBody is of type requestBodySource and if wrong length is supplied for the request body, then subsequent requests will crap out on same HTTP manager for about 20+ seconds (about 20 seconds in
aws
package). There seems to be something about interaction of shared state and GivesPopper perhaps that is causing this issue. Here is a sample code that reproduces it - we use requestb.in for sending wrong length upload, and then try to read another valid URL on requestb.in.Output - first bad upload goes through as
HTTP 200
, and subsequentGET
request immediately causesHTTP 400
error - sometimes, it will beHTTP 403
instead:On wrong streaming length, the behavior shouldn't be to corrupt the HTTP manager as seems to happen here.
I have also simulated a source file for requestBodySource where length is correct, but the source aborts mid-way due to a simulated failure (to simulate network issues). In that case, there are no errors. So, it seems we have just one case where sending wrong length without any failures will cause some kind of shared state to become corrupt here, which gets released within 25 seconds in
aws
package (might be some kind of timeout setting in there).The text was updated successfully, but these errors were encountered: