Fix post and post transform retry#2077
Fix post and post transform retry#2077scw00 wants to merge 1 commit intoapache:masterfrom scw00:disable_post_and_put_retry
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!! |
| 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.
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.