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

hyper server send rst after response 503 #3078

Closed
maxbear1988 opened this issue Dec 8, 2022 · 2 comments
Closed

hyper server send rst after response 503 #3078

maxbear1988 opened this issue Dec 8, 2022 · 2 comments
Labels
C-bug Category: bug. Something is wrong. This is bad!

Comments

@maxbear1988
Copy link

maxbear1988 commented Dec 8, 2022

Version

0.14.20
Platform
Linux kwephis1142986 4.18.0-147.5.2.1.h579.eulerosv2r10.x86_64 #1 SMP Sat Jul 31 09:58:46 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Description

I send a POST request with a large body, and the server responds with 503 immediately before reading the body. Then hyper receives the body data at this time and returns the rst message

I expected to see this happen:
Hope to close the connection gracefully without sending rst

@maxbear1988 maxbear1988 added the C-bug Category: bug. Something is wrong. This is bad! label Dec 8, 2022
@seanmonstar
Copy link
Member

It's hard to know what happened without see the server code.

But if you replied with a 503 immediately without reading request body, then the OS will usually send a RST since it is closing the connection with data still unread.

@seanmonstar seanmonstar closed this as not planned Won't fix, can't repro, duplicate, stale Dec 9, 2022
@maxbear1988
Copy link
Author

@seanmonstar I found some information about fix this problem. we can use shutdown().If we shutdown the write direction of the connection before calling close, we avoid the RST behavior. can you fix this problem in hyper by calling shutdown before close connection?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug. Something is wrong. This is bad!
Projects
None yet
Development

No branches or pull requests

2 participants