Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix empty request body on retries with compression enabled #543

Conversation

merlinz01
Copy link
Contributor

Description

Make the transport use a new reader for each retry when gzip compression is enabled.
Also be more explicit about doing so for non-compressed requests.
Test included.

Issues Resolved

Closes #541.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link

codecov bot commented May 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.96%. Comparing base (06a6dc8) to head (e7ede90).
Report is 24 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #543       +/-   ##
===========================================
+ Coverage   57.29%   67.96%   +10.67%     
===========================================
  Files         315      376       +61     
  Lines        9823     8853      -970     
===========================================
+ Hits         5628     6017      +389     
+ Misses       2902     1555     -1347     
+ Partials     1293     1281       -12     
Flag Coverage Δ
integration 60.39% <100.00%> (+9.55%) ⬆️
unit 15.28% <100.00%> (+2.43%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
opensearchtransport/opensearchtransport.go 86.63% <100.00%> (+1.47%) ⬆️

... and 272 files with indirect coverage changes

@merlinz01 merlinz01 changed the title Fix empty request on retry with compression enabled Fix empty request body on retries with compression enabled May 9, 2024
dblock
dblock previously approved these changes May 13, 2024
@dblock
Copy link
Member

dblock commented May 14, 2024

@merlinz01 Looks like you need to fix DCO (git commit -s --amend), please?

CHANGELOG.md Outdated
@@ -17,6 +17,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

### Fixed

- Fixes empty request body on retry with compression enabled. ([#543](https://github.com/opensearch-project/opensearch-go/pull/543))
Copy link
Member

Choose a reason for hiding this comment

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

Nit: remove period at the end of the sentence, other lines don't have it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@merlinz01 merlinz01 force-pushed the fix-empty-compressed-request-body-on-retry branch from 84d6484 to c8722af Compare May 14, 2024 15:01
@merlinz01 merlinz01 force-pushed the fix-empty-compressed-request-body-on-retry branch from c8722af to e7ede90 Compare May 14, 2024 15:06
@merlinz01
Copy link
Contributor Author

DCO successful.

@dblock dblock merged commit 9cb314d into opensearch-project:main May 14, 2024
53 checks passed
@dblock
Copy link
Member

dblock commented May 14, 2024

Thanks! We have lots of other things in https://github.com/opensearch-project/opensearch-go/issues if you have free time :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Error http: ContentLength=401 with Body length 0
2 participants