fix(batch-requests): the number of sub-responses does not match that of sub-requests#12779
Conversation
…re is any timeout sub request
…mber of sub requests
| --- error_log | ||
| timeout | ||
| --- response_body | ||
| 2 |
There was a problem hiding this comment.
It is recommended to check the specific content, such as the status.
There was a problem hiding this comment.
the original response contains variables such as Date header like : [{"body":"ok","headers":{"Server":"openresty/1.27.1.2","Content-Type":"text/plain","Date":"Thu, 27 Nov 2025 06:46:49 GMT","Connection":"keep-alive","Transfer-Encoding":"chunked"},"status":200,"reason":"OK"},{"status":504,"reason":"upstream timeout"}]', so it is not easy to compare the original content.
There was a problem hiding this comment.
for me, i think we can print two status which is much clear.
like this:
1th response code: 200
2th response code: 504
There was a problem hiding this comment.
Hi @hachi029, please check this comment, thanks.
|
Hi @hachi029, could you merge the latest main branch to make CI pass? |
|
@Baoyuantop merged |
membphis
left a comment
There was a problem hiding this comment.
LGTM, only one minor issue I have leave comment
| --- error_log | ||
| timeout | ||
| --- response_body | ||
| 2 |
There was a problem hiding this comment.
for me, i think we can print two status which is much clear.
like this:
1th response code: 200
2th response code: 504
a631807
|
@membphis The comment has been resolved. Please review it again. |
Description
when there is any timeout sub request, the number of sub responses does not match the number of sub requests。
for example:
the batch-request with 2 sub requests
{"headers":{},"pipeline":[{"path":"/ok","method":"GET"},{"path":"/timeout","method":"GET"}]}there are 3 sub responses in the batch-response, with an extra empty json object '{}'
[{"status":200,"body":"ok","reason":"OK","headers":{"Connection":"keep-alive"}},{"status":504,"reason":"upstream timeout"},{}]Checklist