-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Ingest Manager] Improved verify experience #21573
[Ingest Manager] Improved verify experience #21573
Conversation
Pinging @elastic/ingest-management (Team:Ingest Management) |
/package |
@@ -117,7 +117,7 @@ func (a *Application) Name() string { | |||
|
|||
// Started returns true if the application is started. | |||
func (a *Application) Started() bool { | |||
return a.state.Status != state.Stopped | |||
return a.state.Status != state.Stopped && a.state.Status != state.Crashed && a.state.Status != state.Failed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change?
I think Started()
is trying to say if the application was started at all. If it is crashed or failed you don't want Start()
to be called again, because that state is handled internally in the application abstraction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes in case verification fails, it sets state to FAILING
when it passes in second round is tries to start the app but according to this check it is already running so it tries to configure it right away.
i just unified this check with the one in start.go
so start.go should be unaffected but operation_start.Check
should start functioning as intended (not skipping operation)
@@ -39,7 +39,7 @@ func (a *Application) start(ctx context.Context, t app.Taggable, cfg map[string] | |||
}() | |||
|
|||
// already started if not stopped or crashed | |||
if a.state.Status != state.Stopped && a.state.Status != state.Crashed && a.state.Status != state.Failed { | |||
if a.Started() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The internal start()
is called to restart on a crash. We sure this change with the above change is not going to affect that behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be ok we check it only 2 places here (which stays unaffected, it just looks more readable)
and operation_start.Check which is called on config resolution
I think this change will fix #21120. As that issue has to do with concurrency of updates, that this added mutex will solve. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation. Looks good.
[Ingest Manager] Improved verify experience (elastic#21573)
What does this PR do?
In this PR agent removes downloaded bits even if asc signature does not match (it was only the case for hash up until now)
Then fetch-verify is retried.
This helps mainly with sceanrio when artifacts are built without
.asc
files. So asc file downloaded fromsnapshot
repository matches other build as self build binaries included in agent package.IN this case after initial failure, agent removes self build binaries and downloads snapshot from repository including
sha512
andasc
files.BUT there's a bit more going on in this PR. there's added lock for update method in
emitter
because when dynamic input called Set and Config was Loaded it resulted in two concurrent processing of configuration which tried to setup and run own set of beats and they were fighting overpath.data
location, crashing...This problem sometimes manifested sometimes not, more probably during standalone scenario.
Why is it important?
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.