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

Support Limitless CodedOutputStreams #543

Conversation

AndreKurait
Copy link
Member

@AndreKurait AndreKurait commented Mar 29, 2024

Description

This change adds functionality within the CodedOutputStreamHolder and refactors the StreamChannelConnectionCaptureSerializer to support limitless CodedOutputStreams through new interface method getOutputStreamBytesLimit which can be set to the limit of an underlying byte buffer or -1 for a limitless CodedOutputStreams.

  • Category: Bug Fix
  • Why these changes are required? Currently, the CaptureProxy --noCapture parameter is broken and prevents proxy functionality.
  • What is the old behavior before changes and new behavior after changes? Without this change --noCapture prevents proxy from forwarding requests to the destination, with this change the proxy behaves as expected

Issues Resolved

Issues#540
MIGRATIONS-1616

Is this a backport? If so, please add backport PR # and/or commits #

Testing

Unit Tests

Check List

  • New functionality includes testing
    • All tests pass, including unit test, integration test and doctest
  • [N/A] New functionality has been documented
  • Commits are signed per the DCO using --signoff

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.

@AndreKurait AndreKurait marked this pull request as ready for review March 29, 2024 14:02
Copy link
Collaborator

@gregschohn gregschohn left a comment

Choose a reason for hiding this comment

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

Is there already a test in place that wwill make sure that the limit updating is properly applied and honored? I think that there are some. If you make the limit calculations break, which tests will fail? As long as it's some tests, the approach & testing look good. Though, I'd like to see a helper function that gets the outputstream from the holder to keep the patch tighter and the code shorter.

@AndreKurait AndreKurait force-pushed the SupportLimitlessCodedOutputStream branch from b23f655 to f697eb3 Compare March 29, 2024 15:18
Signed-off-by: Andre Kurait <[email protected]>
@AndreKurait AndreKurait force-pushed the SupportLimitlessCodedOutputStream branch from f697eb3 to 6e490f7 Compare March 29, 2024 17:01
Copy link

codecov bot commented Mar 29, 2024

Codecov Report

Attention: Patch coverage is 95.65217% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 76.59%. Comparing base (077976c) to head (5d05384).
Report is 2 commits behind head on main.

Files Patch % Lines
...ture/StreamChannelConnectionCaptureSerializer.java 93.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #543      +/-   ##
============================================
+ Coverage     76.40%   76.59%   +0.18%     
- Complexity     1383     1398      +15     
============================================
  Files           154      155       +1     
  Lines          5975     5985      +10     
  Branches        538      538              
============================================
+ Hits           4565     4584      +19     
+ Misses         1043     1039       -4     
+ Partials        367      362       -5     
Flag Coverage Δ
unittests 76.59% <95.65%> (+0.18%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AndreKurait AndreKurait merged commit b7231e9 into opensearch-project:main Mar 29, 2024
7 checks passed
@AndreKurait AndreKurait deleted the SupportLimitlessCodedOutputStream branch March 29, 2024 22:54
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.

2 participants