-
Notifications
You must be signed in to change notification settings - Fork 204
Avoid starting and stopping service components on policy change #11740
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
Open
ycombinator
wants to merge
16
commits into
elastic:main
Choose a base branch
from
ycombinator:service-component-avoid-stop-start
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Avoid starting and stopping service components on policy change #11740
ycombinator
wants to merge
16
commits into
elastic:main
from
ycombinator:service-component-avoid-stop-start
+56
−4
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
|
This pull request does not have a backport label. Could you fix it @ycombinator? 🙏
|
84a4523 to
1951fec
Compare
Contributor
|
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
Contributor
💔 Build Failed
Failed CI Steps
History
cc @ycombinator |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR identifies Service Runtime components with only their input type; the output ID is not longer used.
Why is it important?
Service Runtime components are intended to be kept running (via a service) for as long as possible. We should only start or stop them if they are being explicitly added or removed, respectively, from the component model. If only their configuration is being updated, we should not stop and start the component.
If a component's ID changes between the last and current component models, Elastic Agent will as the component's service to stop and then start itself. Prior to this PR, service components' ID were determined by their input type and output ID. Therefore, if a service component's output were changed, it would cause the service to restart. This is undesirable behavior, as services should be kept running as long as possible.
With the changes in this PR, we no longer consider the output ID when generating service components' IDs. If a service component's output is changed, it's ID remains the same between the last and current component models. Elastic Agent does not stop and start the component's service but simply passes the configuration change to it (which it was doing prior to this PR anyway).
Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration files./changelog/fragmentsusing the changelog toolI have added an integration test or an E2E testDisruptive User Impact
None.
How to test this PR locally
default: containing only thesystemintegrationtp-es: containing the Elastic Defend integration, with tamper protection enabled, and using the Elasticsearch output.tp-ls: containing the Elastic Defend integration, with tamper protection enabled, and using the Logstash output. Note that you will need to create the Logstash output in Fleet > Settings.tp-espolicy and verify the agent is healthy and shipping data.tp-lspolicy.stopping endpoint service runtime./opt/Elastic/Endpoint/state/log/on Linux) and make sure that Endpoint has connected to Logstash (or has attempted to and failed if there is no actual Logstash endpoint listening).defaultpolicy.stopping endpoint service runtime, followed byuninstall endpoint service, followed byStopped: endpoint service runtime.Related issues
Questions to ask yourself