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

Adding support for handling multiple transport protocols #12967

Merged
merged 11 commits into from
Apr 8, 2024

Conversation

VachaShah
Copy link
Collaborator

@VachaShah VachaShah commented Mar 28, 2024

Description

Coming from PR #11910, separating out the transport protocol logic which is part of #11910 into this PR. This PR adds support to make it easier to handle multiple transport protocols.

Related Issues

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Failing checks are inspected and point to the corresponding known issue(s) (See: Troubleshooting Failing Builds)
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)
  • Public documentation issue/PR created

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
Contributor

github-actions bot commented Mar 28, 2024

Compatibility status:

Checks if related components are compatible with change 3f08cea

Incompatible components

Skipped components

Compatible components

Compatible components: [https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/flow-framework.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/sql.git]

Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

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

I like the small PR that we can reason about and get merged.

I don't love the existing naming of these classes. Does it make sense to move and rename things now? I would like folders for different implementations like native and proto so there's no confusion that these things are standalone.

For example:

|-transport
    |----InboundMessage [an interface only, `getProtocol()`, no `setProtocol()`] 
    |----native
               |- NativeInboundMessage
    |----proto
               |-ProtoInboundMessage

Copy link
Contributor

✅ Gradle check result for 9d2353a: SUCCESS

@VachaShah
Copy link
Collaborator Author

I like the small PR that we can reason about and get merged.

I don't love the existing naming of these classes. Does it make sense to move and rename things now? I would like folders for different implementations like native and proto so there's no confusion that these things are standalone.

For example:

|-transport
    |----InboundMessage [an interface only, `getProtocol()`, no `setProtocol()`] 
    |----native
               |- NativeInboundMessage
    |----proto
               |-ProtoInboundMessage

Renaming would definitely make it clearer, I didn't opt it for existing classes since it would be a breaking change no? For example, InboundMessage is declared as a PublicApi.

Copy link

codecov bot commented Mar 28, 2024

Codecov Report

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

Project coverage is 71.39%. Comparing base (b15cb0c) to head (3f08cea).
Report is 139 commits behind head on main.

Files Patch % Lines
...org/opensearch/transport/NativeMessageHandler.java 89.32% 11 Missing and 8 partials ⚠️
...port/nativeprotocol/NativeInboundBytesHandler.java 88.73% 0 Missing and 8 partials ⚠️
...java/org/opensearch/transport/InboundPipeline.java 66.66% 1 Missing and 3 partials ⚠️
...transport/nativeprotocol/NativeInboundMessage.java 90.90% 2 Missing and 2 partials ⚠️
.../java/org/opensearch/transport/InboundHandler.java 66.66% 1 Missing and 1 partial ⚠️
...in/java/org/opensearch/transport/TcpTransport.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #12967      +/-   ##
============================================
- Coverage     71.42%   71.39%   -0.03%     
- Complexity    59978    60457     +479     
============================================
  Files          4985     5029      +44     
  Lines        282275   284589    +2314     
  Branches      40946    41221     +275     
============================================
+ Hits         201603   203184    +1581     
- Misses        63999    64619     +620     
- Partials      16673    16786     +113     

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

@VachaShah
Copy link
Collaborator Author

Made the minor changes in new commit. @reta @msfroh Please take a look. Thank you!

@VachaShah VachaShah requested a review from msfroh April 6, 2024 00:12
Copy link
Contributor

github-actions bot commented Apr 6, 2024

❌ Gradle check result for 8a90d0e: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@VachaShah
Copy link
Collaborator Author

❌ Gradle check result for 8a90d0e: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

#12197

Copy link
Contributor

github-actions bot commented Apr 6, 2024

❌ Gradle check result for 8a90d0e: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

github-actions bot commented Apr 8, 2024

❌ Gradle check result for 208d75b: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Signed-off-by: Vacha Shah <vachshah@amazon.com>
Copy link
Contributor

github-actions bot commented Apr 8, 2024

✅ Gradle check result for 3f08cea: SUCCESS

@VachaShah
Copy link
Collaborator Author

@dblock Can you please take a look at this again? Thank you!

Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

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

This looks straightforward enough for me, if @reta is cool with it lets merge.

@dblock dblock added the backport 2.x Backport to 2.x branch label Apr 8, 2024
@dblock dblock merged commit d202d90 into opensearch-project:main Apr 8, 2024
36 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.x
# Create a new branch
git switch --create backport/backport-12967-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 d202d90df3991daaf3e20be325cac4b323f0ed23
# Push it to GitHub
git push --set-upstream origin backport/backport-12967-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-12967-to-2.x.

@VachaShah
Copy link
Collaborator Author

Thank you @dblock and @reta! I will add an issue for the discussion and will backport this manually.

VachaShah added a commit to VachaShah/OpenSearch that referenced this pull request Apr 8, 2024
…project#12967)

* Adding support for more than one protocol for transport

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Adding CHANGELOG entry

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Addressing comments

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Addressing comments

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Removing determineTransportProtocol

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Determine transport protocol only on first byte reference

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Making InboundBytesHandler closeable

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Fixing close() for InboundPipeline

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Adding DeprecatedAPI annotation to japicmp task

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Fixing for detect breaking changes workflow

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Fixing recursion

Signed-off-by: Vacha Shah <vachshah@amazon.com>

---------

Signed-off-by: Vacha Shah <vachshah@amazon.com>
@VachaShah
Copy link
Collaborator Author

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.x
# Create a new branch
git switch --create backport/backport-12967-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 d202d90df3991daaf3e20be325cac4b323f0ed23
# Push it to GitHub
git push --set-upstream origin backport/backport-12967-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-12967-to-2.x.

Backport PR #13125

reta pushed a commit that referenced this pull request Apr 9, 2024
…ls (#12967) (#13125)

* Adding support for handling multiple transport protocols (#12967)

* Adding support for more than one protocol for transport

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Adding CHANGELOG entry

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Addressing comments

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Addressing comments

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Removing determineTransportProtocol

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Determine transport protocol only on first byte reference

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Making InboundBytesHandler closeable

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Fixing close() for InboundPipeline

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Adding DeprecatedAPI annotation to japicmp task

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Fixing for detect breaking changes workflow

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Fixing recursion

Signed-off-by: Vacha Shah <vachshah@amazon.com>

---------

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Fixing precommit for 2.x

Signed-off-by: Vacha Shah <vachshah@amazon.com>

---------

Signed-off-by: Vacha Shah <vachshah@amazon.com>
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
…project#12967)

* Adding support for more than one protocol for transport

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Adding CHANGELOG entry

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Addressing comments

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Addressing comments

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Removing determineTransportProtocol

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Determine transport protocol only on first byte reference

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Making InboundBytesHandler closeable

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Fixing close() for InboundPipeline

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Adding DeprecatedAPI annotation to japicmp task

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Fixing for detect breaking changes workflow

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Fixing recursion

Signed-off-by: Vacha Shah <vachshah@amazon.com>

---------

Signed-off-by: Vacha Shah <vachshah@amazon.com>
Signed-off-by: Shivansh Arora <hishiv@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants