Skip to content
This repository was archived by the owner on Oct 12, 2026. It is now read-only.

Test object PUT with chunked transfer encoding - #501

Merged
cbodley merged 1 commit into
ceph:masterfrom
mkogan1:wip-chunked-trans-enc
Apr 7, 2023
Merged

cbodley merged 1 commit into
ceph:masterfrom
mkogan1:wip-chunked-trans-enc

Conversation

@mkogan1

@mkogan1 mkogan1 commented Mar 7, 2023

Copy link
Copy Markdown
Contributor

Before the RGW fix PR was responding with 411 instead of 200

RGW fix PR: ceph/ceph#50235

Before the RGW fix PR was responding with 411 instead of 200

RGW fix PR: ceph/ceph#50235

Signed-off-by: Mark Kogan <[email protected]>

@razdob15 razdob15 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ContentLength header shouldn't be sent.



def _ev_add_te_header(request, **kwargs):
request.headers.add_header('Transfer-Encoding', 'chunked')

@razdob15 razdob15 Mar 7, 2023 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error the cu gets is 411: MissigContentLength.
Hence, in addition to the te header addition, you have to ensure that the ContentLength header does not exist in the request, in order to reproduce the exact error in this test.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before the RGW fix PR was responding with 411 instead of 200

i'm seeing the same behavior that @mkogan1 claimed in the PR description. running against radosgw without the fix from ceph/ceph#50235, it doesn't get a content-length header so rejects the request with 411:

FAILED s3tests_boto3/functional/test_s3.py::test_object_write_with_chunked_transfer_encoding - botocore.exceptions.ClientError: An error occurred (MissingContentLength) when calling the PutObject operation: Unknown

i assume that boto isn't adding a content-length header because it sees the transfer-encoding header; are you seeing a case where boto still sends a content-length?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@razdob15 corroborating, as @cbodley said - inspecting debug_rgw=20 logs of the test run,
the ContentLength header does not exist when HTTP_TRANSFER_ENCODING=chunked

less ./out/radosgw.8000.log
...
2023-03-08T08:37:28.196+0000 7ffed2ff5700 20 HTTP_ACCEPT_ENCODING=identity                                                                                               
2023-03-08T08:37:28.196+0000 7ffed2ff5700 20 HTTP_AMZ_SDK_INVOCATION_ID=313aaf03-4a88-4144-ae47-83f1b085fd14                                                             
2023-03-08T08:37:28.196+0000 7ffed2ff5700 20 HTTP_AMZ_SDK_REQUEST=attempt=1                                                                                              
2023-03-08T08:37:28.196+0000 7ffed2ff5700 20 HTTP_AUTHORIZATION=AWS4-HMAC-SHA256 Credential=0555b35654ad1656d804/20230308/us-east-1/s3/aws4_request, SignedHeaders=conten
2023-03-08T08:37:28.196+0000 7ffed2ff5700 20 HTTP_CONTENT_MD5=N7UdGUp1E+RbVvZSTy1R8g==                                                                                   
2023-03-08T08:37:28.196+0000 7ffed2ff5700 20 HTTP_EXPECT=100-continue                                                                                                    
2023-03-08T08:37:28.196+0000 7ffed2ff5700 20 HTTP_HOST=localhost:8000                                                                                                    
2023-03-08T08:37:28.196+0000 7ffed2ff5700 20 HTTP_TRANSFER_ENCODING=chunked  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                            
2023-03-08T08:37:28.196+0000 7ffed2ff5700 20 HTTP_USER_AGENT=Boto3/1.23.10 Python/3.6.8 Linux/5.16.2-1.el8.elrepo.x86_64 Botocore/1.26.10                                
2023-03-08T08:37:28.196+0000 7ffed2ff5700 20 HTTP_VERSION=1.1                                                                                                            
2023-03-08T08:37:28.196+0000 7ffed2ff5700 20 HTTP_X_AMZ_CONTENT_SHA256=fcde2b2edba56bf408601fb721fe9b5c338d10ee429ea04fae5511b68fbf8fb9                                  
2023-03-08T08:37:28.196+0000 7ffed2ff5700 20 HTTP_X_AMZ_DATE=20230308T083728Z                                                                                            
2023-03-08T08:37:28.196+0000 7ffed2ff5700 20 REMOTE_ADDR=::1                                                                                                             
2023-03-08T08:37:28.196+0000 7ffed2ff5700 20 REQUEST_METHOD=PUT                                                                                                          
2023-03-08T08:37:28.196+0000 7ffed2ff5700 20 REQUEST_URI=/yournamehere-ar5dkrz1pexwp87r-109/foo                                                                          
2023-03-08T08:37:28.196+0000 7ffed2ff5700 20 SCRIPT_URI=/yournamehere-ar5dkrz1pexwp87r-109/foo                                                                           
2023-03-08T08:37:28.196+0000 7ffed2ff5700 20 SERVER_PORT=8000                                                                                                            
2023-03-08T08:37:28.196+0000 7ffed2ff5700  1 ====== starting new request req=0x7fffe07f7060 =====                                                                        
...
2023-03-08T08:37:28.205+0000 7ffeddffb700  1 ====== req done req=0x7fffe07f7060 op status=0 http_status=200 latency=0.009000175s ======
2023-03-08T08:37:28.205+0000 7ffeddffb700  1 beast: 0x7fffe07f7060: ::1 - testid [08/Mar/2023:08:37:28.196 +0000] "PUT /yournamehere-ar5dkrz1pexwp87r-109/foo HTTP/1.1" 200 3 - "Boto3/1.23.10 Python/3.6.8 Linux/5.16.2-1.el8.elrepo.x86_64 Botocore/1.26.10" - latency=0.009000175s

@mkogan1

mkogan1 commented Mar 21, 2023

Copy link
Copy Markdown
Contributor Author

@mkogan1
mkogan1 requested a review from cbodley March 21, 2023 15:35
@cbodley
cbodley merged commit c445361 into ceph:master Apr 7, 2023
@cbodley

cbodley commented Apr 7, 2023

Copy link
Copy Markdown
Contributor

cherry-picked to ceph-master

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants