-
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
[Heartbeat] Fix Continuation Dispatch / mode: all pings #12458
Conversation
Currently mode: all pings are broken. The root cause is that the scheduler dispatch of continuations in the heartbeat task model is broken. Since the only current use of this is `mode:all` pings that is what is affected. The issue was incorrectly aliasing variables when dispatching future work. This issue is well described on this wiki page https://github.com/golang/go/wiki/CommonMistakes
Pinging @elastic/uptime |
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.
Code change LGTM. When did we introduce this or was it always broken?
Could you add a changelog entry?
@ruflin looks like I introduced this in 7.0.1 when I inlined this function call https://github.com/elastic/beats/pull/11895/files#diff-4d4178828d8a492b11ba6f28898cef10L122 |
@@ -162,15 +162,20 @@ func runPublishJob(job jobs.Job, client beat.Client) []scheduler.TaskFunc { | |||
} | |||
} | |||
|
|||
if len(next) == 0 { | |||
if !hasContinuations { |
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 added this here since it makes the code more readable. I know this is a bug fix, but I think some small cleanup of this function goes to that since hard to maintain code carries bug risk.
@ruflin added the CHANGELOG entry, also cleaned up one small thing. LMK if you think that's out of scope. |
Currently mode: all pings are broken. The root cause is that the scheduler dispatch of continuations in the heartbeat task model is broken. Since the only current use of this is `mode:all` pings that is what is affected. The issue was incorrectly aliasing variables when dispatching future work. This issue is well described on this wiki page https://github.com/golang/go/wiki/CommonMistakes (cherry picked from commit e491e9a)
) Currently mode: all pings are broken. The root cause is that the scheduler dispatch of continuations in the heartbeat task model is broken. Since the only current use of this is `mode:all` pings that is what is affected. The issue was incorrectly aliasing variables when dispatching future work. This issue is well described on this wiki page https://github.com/golang/go/wiki/CommonMistakes (cherry picked from commit e491e9a)
Currently mode: all pings are broken. The root cause is that the scheduler dispatch of continuations in the heartbeat task model is broken. Since the only current use of this is `mode:all` pings that is what is affected. The issue was incorrectly aliasing variables when dispatching future work. This issue is well described on this wiki page https://github.com/golang/go/wiki/CommonMistakes
… (elastic#12477) Currently mode: all pings are broken. The root cause is that the scheduler dispatch of continuations in the heartbeat task model is broken. Since the only current use of this is `mode:all` pings that is what is affected. The issue was incorrectly aliasing variables when dispatching future work. This issue is well described on this wiki page https://github.com/golang/go/wiki/CommonMistakes (cherry picked from commit 4cc0a1c)
Currently mode: all pings are broken. The root cause is that the scheduler dispatch of continuations in the heartbeat task model is broken. Since the only current use of this is
mode:all
pings that is what is affected. The issue was incorrectly aliasing variables when dispatching future work.This patch also renames some of the related variables to make understanding the code here simpler.
This issue is well described on this wiki page https://github.com/golang/go/wiki/CommonMistakes