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
[Heartbeat] Add publish pipeline timeout to run_once #35721
[Heartbeat] Add publish pipeline timeout to run_once #35721
Conversation
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
Pinging @elastic/uptime (Team:Uptime) |
/test |
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.
Just did a first pass, Code changes LGTM. However I did not have a change to run all the test cases yet.
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.
LGTM, Great work 🎉
Nothing blocking though, Added few comments. Also, I tested different modes with HTTP, Browser monitors. Looking good so far.
@@ -211,20 +211,34 @@ func (bt *Heartbeat) Run(b *beat.Beat) error { | |||
|
|||
defer bt.scheduler.Stop() | |||
|
|||
<-bt.done | |||
// Wait until run_once ends or bt is being shut down | |||
waitMonitors.AddChan(bt.done) |
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.
I don't remember if we ever waited for Kill signal from the OS or any interrupts? Not blocking the PR, just want to understand if we are handling anything differently here.
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, any interrupt is handled by libbeat which in turn triggers heartbeat.Stop()
and finally <-bt.done
. This is just replicating the same condition using the wait signal approach and listening both for interrupts OR run once finished event, if in run once mode.
Decouples run_once from sync pipeline and adds a timeout before exiting for emitting pending events. * Add publish pipeline timeout to run_once * Clean up ISyncClient * Nit wait for run_once * Rename pipeline * Add signal tests * Add pipeline sync tests * Disable linter false positive * golint * Apply suggestions from code review * Update heartbeat/monitors/pipeline.go * Apply suggestions from code review * Add changelog and docs
What does this PR do?
Closes #35706.
Decouples run_once from sync pipeline and adds a timeout before exiting for emitting pending events.
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.How to test this PR locally
https://localhost:9200/
without it running locally.heartbeat.publish_timeout: 15s
toheartbeat.yml