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 component control protocol to allow checkin to be chunked across multiple messages #3884

Merged
merged 14 commits into from
Jan 18, 2024

Conversation

blakerouse
Copy link
Contributor

@blakerouse blakerouse commented Dec 7, 2023

What does this PR do?

Fixes component control protocol to allow checkin to be chunked across multiple messages. It is backwards compatible as well, so only clients that inform the Elastic Agent that they support chunking will chunking be used when the message is larger than that max message size.

Why is it important?

Fixes a core issue where when running large amounts of inputs in a single component that the Elastic Agent was unable to communicate the information because the amount of data being sent between the Elastic Agent and the component was larger than the max message size.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool
  • [ ] I have added an integration test or an E2E test (tested in a unit test)

Author's Checklist

  • Enables chunking support when communicating with the Elastic Agent.

How to test this PR locally

$ cd ../beats
$ git checkout blakerouse/agent-client-chunking
$ cd ../elastic-agent
$ mage package  # not using `EXTERNAL=true`

Related issues

@blakerouse blakerouse added bug Something isn't working Team:Elastic-Agent Label for the Agent team backport-skip labels Dec 7, 2023
@blakerouse blakerouse self-assigned this Dec 7, 2023
@blakerouse blakerouse requested a review from a team as a code owner December 7, 2023 19:04
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent (Team:Elastic-Agent)

@blakerouse
Copy link
Contributor Author

go.mod replace will be removed once elastic/elastic-agent-client#89 is merged

@pchila pchila self-requested a review December 13, 2023 14:59
pkg/component/runtime/manager.go Show resolved Hide resolved
pkg/component/runtime/runtime_comm.go Outdated Show resolved Hide resolved
@blakerouse
Copy link
Contributor Author

go.mod replace has been removed now that v7.6.0 of the elastic-agent-client has been released.

@blakerouse blakerouse enabled auto-merge (squash) December 18, 2023 16:21
pkg/component/runtime/manager_test.go Outdated Show resolved Hide resolved
pkg/component/runtime/manager_test.go Outdated Show resolved Hide resolved
@cmacknz
Copy link
Member

cmacknz commented Dec 18, 2023

One other thought to minimize risk when we release this, and give us an option to isolate whether chunking is causing problems: can we add a configuration option in the policy to disable chunking? Perhaps by having the agent declare that it doesn't support chunking?

Copy link
Contributor

mergify bot commented Dec 19, 2023

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b control-protocol-chunking upstream/control-protocol-chunking
git merge upstream/main
git push upstream control-protocol-chunking

@blakerouse
Copy link
Contributor Author

One other thought to minimize risk when we release this, and give us an option to isolate whether chunking is causing problems: can we add a configuration option in the policy to disable chunking? Perhaps by having the agent declare that it doesn't support chunking?

I added this.

@cmacknz
Copy link
Member

cmacknz commented Jan 8, 2024

Latest changes LGTM, will approve once we get passing tests.

@pierrehilbert
Copy link
Contributor

The CI failure seems unrelated (#4076)

Copy link
Contributor

mergify bot commented Jan 17, 2024

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b control-protocol-chunking upstream/control-protocol-chunking
git merge upstream/main
git push upstream control-protocol-chunking

Copy link

@blakerouse blakerouse merged commit caaf078 into elastic:main Jan 18, 2024
9 checks passed
@blakerouse blakerouse deleted the control-protocol-chunking branch January 18, 2024 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-skip bug Something isn't working Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Control protocol checkin payloads can exceed the gRPC maximum message size when using autodiscovery
6 participants