Skip to content
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

Occasionally ATS does not send the full request body to upstream #11038

Open
hnakamur opened this issue Feb 5, 2024 · 1 comment
Open

Occasionally ATS does not send the full request body to upstream #11038

hnakamur opened this issue Feb 5, 2024 · 1 comment
Assignees
Labels

Comments

@hnakamur
Copy link
Contributor

hnakamur commented Feb 5, 2024

During my experiments involving the sending of numerous requests with a 1KiB body, I have observed that ATS occasionally fails to transmit the complete request body to the upstream server.

I have provided a reproducible case of this issue on GitHub:
https://github.com/hnakamur/ats-nginx-bad-request/tree/enable_debug_log

Additionally, log files and TCP dump outputs have been included within the repository to facilitate further analysis.

In contrast to the expected Content-Length: 1024 request header, as shown in this specific log, ATS only transmits 344 bytes of the body.

Your assistance in investigating this matter further would be greatly appreciated.

Thank you.

@bryancall bryancall self-assigned this Feb 5, 2024
@hnakamur
Copy link
Contributor Author

hnakamur commented Feb 22, 2024

I found this issue is reproducible in 9.2.3 or 10.0.x.

Also I did another experiment with a debug log added:.

In https://github.com/hnakamur/ats-nginx-bad-request/blob/ats-submodule/tcpdump-nginx-2b.log, ATS sent request body of length 344 as opposed to Content-Length: 1024 request header.

I found reader_start_offset (_ua.get_txn()->get_remote_reader()->start_offset) is always 3752 when written partial body length is 344 in start_offset.log.

$ grep -c num_body_bytes=344, start_offset.log
64
$ grep num_body_bytes=344, start_offset.log | grep -c -v reader_start_offset=3752
0

I noticed the sum of 3752 and 344 is 4096 (4KiB).

$ echo '3752 + 344' | bc
4096

I still don't have a clue why this issue happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants