OpenLiberty / open-liberty

Open Liberty is a highly composable, fast to start, dynamic application server runtime environment
https://openliberty.io
Eclipse Public License 2.0
1.14k stars 583 forks source link

Change default behavior to not close keepalive sockets on responses with codes 400, 402-417, or 500-505 #16521

Open kgibm opened 3 years ago

kgibm commented 3 years ago

Liberty closes HTTP 1.0/1.1 keepalive connection if the response code is 400, 402-417, or 500-505 (any StatusCodes instance with the third parameter set to true). This is a more obscure performance use case, but sometimes app updates are rolled out that have more errors and that may lead to unnecessary performance investigations, or questions about sockets in CLOSE_WAIT and TIME_WAIT.

In addition, the specification for Bean Validation purposely says to return a 400 when a parameter doesn't pass validation.

kgibm commented 3 years ago

HTTP 1.1 RFCs:

kgibm commented 3 years ago

The design issues call consensus was to keep the existing behavior if such a response is sent back as part of processing in the HTTP channel but once the request is dispatched out of the HTTP stack (e.g. into WebContainer), then such a response code should not close the keepalive connection.

kgibm commented 1 year ago

Related: https://cloud-platform.ideas.ibm.com/ideas/LIBERTY-I-92