-
Notifications
You must be signed in to change notification settings - Fork 844
Fix post and post transform retry #2077
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
Conversation
|
golang test script output That we can see, we send the post request without data in previous request. In the retry |
|
[approve ci] @zwoop Is the autest system support golang script ? |
|
POST and PUT should be retryable if we haven't sent any data to the origin. The first conditional checks the method and if there have been any bytes sent. The data should still be around if we haven't tried to write it to the origin. Something else looks to be broken. |
|
@bryancall you are right. The reason is that we have already consumed the ua_buffer_reader in do_setup_post_tunnel We will got nothing in the next term. It can be fixed simply to remove this consume. And I will push another pr later. @zwoop |
|
@oknet @zwoop @bryancall Please review!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the server connection retry mechanism of POST & PUT method never works correctly.
proxy/http/HttpSM.cc
Outdated
| ua_buffer_reader->consume(client_request_body_bytes); | ||
| // Note: We can not consume the data sice we start retry. | ||
| // ua_buffer_reader will be destroy in HttpSessionClient::free | ||
| // ua_buffer_reader->consume(client_request_body_bytes); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ua_buffer_reader only keeps the first part of request payload. If the tunnel has read the second part of the request payload, the ATS will only replay the first part of request payload when retry to another server and the second part will be lost.
|
#1994 |
|
[approve ci] |
|
The post request has blocked by #2123 sometimes . It will be fixed when #2123 merge. Now, that is working well with post request. Fake vc is running in the same thread. fvc will collect all data before it call sm . If post succeed or post failed entirely, fvc will use fvc_callcont to return state machine in tunnel_handler_fake. If we connect to server and send data successfully, the default handler (tunnel_handler_post)will be used. If server aborted, we will setup fake vc ->server tunnel directly, and send the data collected by fvc. fvc is freed in tunnel reset or kill tunnel. we can use 'proxy.config.http.tunnel_faker_enabled' to enable this feature. |
Currently, the post and put request can not work together with server connection retry mechanism.
Because ATS can not replay the post content.