Comments (6)
I saw that conversation, and my reading of the RFC is that no additional requests following the current in-progress request may be sent after receiving Connection: close
. The RFC 9112 Section 9.5 paragraph 5 that Michael quoted in particular seems to heavily imply to me that the in-progress body does not need to be immediately terminated when a non-error response with Connection: close
is received.
Looking at curl's commit history, their behavior of terminating of in-progress body transmissions upon receipt of a 200 response with Connection: close
(or the absence of Connection: keep-alive
for HTTP/1.0) started with curl/curl@c67a99f. Following the bug report in that commit message, it appears that this was implemented due to curl continuing to send data after receiving error responses with Connection: close
, with no discussion about non-error responses. Based on that, it seems to me that the curl behavior on a 200 response with Connection: close
may have been less of an explicit design choice and more of an unhandled corner case.
That being said, since this curl behavior has existed since 2008, that probably means that this is not a situation that is encountered often, so it may not matter what the client's behavior is in practice.
from aws-c-s3.
Thank you for reporting the issue and the detail investigation!
We just merged the fix from aws-c-http, it should fix the issue here.
from aws-c-s3.
Which language CRT are you using to get at aws-c-s3? aws-crt-java? aws-crt-cpp?
btw thank you for the AMAZING deep dive writeup. It really helped us dive right into a fix
from aws-c-s3.
Thank you for reporting the issue and the detail investigation!
We just merged the fix from aws-c-http, it should fix the issue here.
Awesome! I'll give it a test soon to ensure that my issue has been fixed.
Which language CRT are you using to get at aws-c-s3? aws-crt-java? aws-crt-cpp?
I'm using the C CRT libraries directly.
btw thank you for the AMAZING deep dive writeup. It really helped us dive right into a fix
Of course! I try to provide the level of detail in problem descriptions and debug information that I'd like to receive myself. Thank you two for the quick turnaround.
from aws-c-s3.
The changes in awslabs/aws-c-http@0600662 appear to fix the issue, thanks!
FWIW, I haven't encountered this as an issue, but it does seem to me that it might make sense to finish transmitting the (current) request even after receiving a complete Connection: close
response if the response status is < 300, although I'm not sure how often that situation arises in practice. If such a change did get implemented, I believe that an additional change would be needed to ensure that reads (on leftward slots) do truly stop after the client finishes processing the response while transmission continues. But I digress.
from aws-c-s3.
We thought about it. part of conversation can be found here
The reasons that we just end transmitting after connection: close
no matter what response status:
- The spec said MUST cease, it's a bit ambiguous
A client that receives a "close" connection option MUST cease sending requests on that connection and close the connection after reading the response message containing the "close" connection option
- I also tested with curl against a local host. curl also stops sending with 200 and
connection: close
, some log from curl
* Mark bundle as not supporting multiuse
< HTTP/1.1 200
< Server: mock_s3_server
< ETag: b54357faf0632cce46e942fa68356b38
< Connection: close
< Content-Length: 0
<
* we are done reading and this is set to close, stop send
* Mark bundle as not supporting multiuse
< HTTP/1.1 200
< Server: mock_s3_server
< ETag: b54357faf0632cce46e942fa68356b38
< Connection: keep-alive
< Content-Length: 0
<
* We are completely uploaded and fine
from aws-c-s3.
Related Issues (20)
- [s3 endpoint] aws_s3_client_endpoint_release race condition produces segmentation faults HOT 1
- Hard-coded Host header domain in aws_s3_get_object_size_message_new HOT 1
- TCP keep-alive settings that have proved useful HOT 1
- FreeBSD port: testunit fails HOT 3
- s3_request: num_requests_in_flight not reduced due to nil client field HOT 1
- [s3_auto_ranged_get] off-by-one error in calculating the end of the range
- `test_s3_get_performance` is an invalid test name HOT 4
- [Feature Request]: support for multi-part byte ranges HOT 1
- [auto-ranged PUT]: CompleteMultipartUpload called while 1 multipart upload is missing HOT 6
- [CopyObject]: please re-enable client support and tests for CopyObject
- Improve Samples HOT 1
- S3-Transfer-Manager Streaming HOT 22
- Failed to build dependencies on ubuntu 20 HOT 5
- Fail to download full folder with 15K images and 7K text files HOT 17
- Trouble to try the samples in my S3 account HOT 5
- Faster Paging HOT 3
- Issue about possible mistake "bad copypast" HOT 1
- Handle range header client-side HOT 4
- Build broken since #360 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-c-s3.