Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.15.0
Description
The HTTP/1.x codec does not handle HTTP/1.0 connection lifecycle correctly. There is a race when the HTTP/1.0 server sends a response with a valid content-length to a router that has queued multiple outstanding request messages. The adaptor does not wait for the connection to close after the response is received and begins to send the next pending request as the server is closing the connection.
From RFC7230, Persistence:
A recipient determines whether a connection is persistent or not based on the most recently received message’s protocol version and Connection header field (if any):
o If the "close" connection option is present, the connection will not persist after the current response; else,
o If the received protocol is HTTP/1.1 (or later), the connection will persist after the current response; else,
o If the received protocol is HTTP/1.0, the "keep-alive" connection option is present, the recipient is not a proxy, and the recipient wishes to honor the HTTP/1.0 "keep-alive" mechanism, the connection will persist after the current response; otherwise,
o The connection will close after the current response. A client MAY send additional requests on a persistent connection until it sends or receives a "close" connection option or receives an HTTP/1.0 response without a "keep-alive" connection option.