]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rgw/beast: disable keepalive for responses before 100 Continue 65864/head
authorCasey Bodley <cbodley@redhat.com>
Thu, 9 Oct 2025 16:30:07 +0000 (12:30 -0400)
committerCasey Bodley <cbodley@redhat.com>
Thu, 9 Oct 2025 16:59:32 +0000 (12:59 -0400)
commitf96e92ae0f099f4ef92547323e9d98d3fe246d1f
tree217bc59336e0f08301e3aeaf7b14ffd071138c88
parentaea1dd81cd6e048a5f535fb0f2b9acc2d0c794b1
rgw/beast: disable keepalive for responses before 100 Continue

resolves a long-standing category of delays/errors from boto3 for
requests like s3:PutObject that contain a request body and use the
`Expect: 100-continue` request header. if the server rejects such
requests based on their headers alone, it will respond with an http
status like `HTTP/1.1 403 Forbidden` without first sending the
`HTTP/1.1 100 Continue` status

when http keepalive is enabled, this situation creates an ambiguity for
the server when trying to read the next request from that connection -
subsequent bytes may either correspond to the current request's body or
the next request's headers

to resolve this ambiguity, disable http keepalive by sending response
header `Connection: close` instead of `Connection: keep-alive`. this
instructs the client and server to close this connection instead of
reusing it for subsequent requests

Fixes: https://tracker.ceph.com/issues/42208
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_asio_client.cc
src/rgw/rgw_asio_client.h
src/rgw/rgw_asio_frontend.cc