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

Respond 408 status when the server didn't receive request fully until it's timed out #5579

Open
minwoox opened this issue Apr 8, 2024 · 5 comments
Labels

Comments

@minwoox
Copy link
Member

minwoox commented Apr 8, 2024

Currently, we always respond with 503 if a RequestTimeoutException is raised.
However, we should send 408 status if the server didn't receive the request fully.

The 408 (Request Timeout) status code indicates that the server did not receive a complete request message within the time that it was prepared to wait.

https://httpwg.org/specs/rfc9110.html#status.408

Related: #5572

@minwoox minwoox added the defect label Apr 8, 2024
@thachlp
Copy link
Member

thachlp commented Apr 16, 2024

Can I work on this?

@minwoox
Copy link
Member Author

minwoox commented Apr 16, 2024

Hi, @thachlp!
We are currently addressing some timeout-related issues, so I believe this task should be completed after that. I will inform you once the timeout issues have been resolved.

@thachlp
Copy link
Member

thachlp commented Apr 16, 2024

Hi, @thachlp! We are currently addressing some timeout-related issues, so I believe this task should be completed after that. I will inform you once the timeout issues have been resolved.

Thanks

minwoox added a commit to minwoox/armeria that referenced this issue May 16, 2024
…lly.

Motivation:
Currently, the server always responds with a 503 status if a `RequestTimeoutException` is raised.
However, according to the RFC 9110, the correct response in this case should be a 408 status code.
https://httpwg.org/specs/rfc9110.html#status.408
```
The 408 (Request Timeout) status code indicates that the server did not receive a complete request message within the time that it was prepared to wait.
```

Modification:
- Introduced `DecodedHttpRequest.isNormallyClosed()` to check if the request was received fully.
- Updated the server to send a 408 response when a request times out and the service didn't receive the request fully.

Result:
- The server now returns a 408 status if a service didn't receive the request fully and the request times out.
- Issue line#5579 has been closed.
@minwoox
Copy link
Member Author

minwoox commented May 16, 2024

@thachlp, Sorry I had to do this by myself because it's more complicated than I initially thought. 😓

@thachlp
Copy link
Member

thachlp commented May 16, 2024

@thachlp, Sorry I had to do this by myself because it's more complicated than I initially thought. 😓

It is fine, thank you for information 🙇

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