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

Cherry-pick #20570 to 7.x: Stop Heartbeat monitor jobs on cancelation #20587

Merged
merged 1 commit into from
Aug 14, 2020

Conversation

jsoriano
Copy link
Member

@jsoriano jsoriano commented Aug 13, 2020

Cherry-pick of PR #20570 to 7.x branch. Original message:

If a monitor is stopped, for example when using autodiscover, the
scheduled tasks should be stopped too. Scheduler was rescheduling tasks
forever once started, though these tasks were not being executed because
they are also aware of the context.

This change avoids the execution and rescheduling of tasks once its job
context is done.

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.next.asciidoc or CHANGELOG-developer.next.asciidoc.

How to test this PR locally

  • Start heartbeat with autodiscover enabled and -d scheduler.
  • Start some container/pod.
  • Wait for the monitor to be configured and executed.
  • Stop the container/pod.
  • Messages about jobs execution like the following one should eventually stop appearing:
2020-08-12T13:13:43.705+0200	DEBUG	[scheduler]	scheduler/scheduler.go:201	Job 'auto-http-0X2C5537D51C1B9524' returned at 2020-08-12 13:13:43.70518639 +0200 CEST m=+66.010433861

Related issues

If a monitor is stopped, for example when using autodiscover, the
scheduled tasks should be stopped too. Scheduler was rescheduling tasks
forever once started, though these tasks were not being executed because
they are also aware of the context.

This change avoids the execution and rescheduling of tasks once its job
context is done.

(cherry picked from commit a6d98d6)
@jsoriano jsoriano requested a review from a team as a code owner August 13, 2020 13:59
@jsoriano jsoriano added [zube]: In Review backport Team:obs-ds-hosted-services Label for the Observability Hosted Services team labels Aug 13, 2020
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Aug 13, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/uptime (Team:Uptime)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Aug 13, 2020
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #20587 opened]

  • Start Time: 2020-08-13T14:00:28.746+0000

  • Duration: 63 min 20 sec

Test stats 🧪

Test Results
Failed 0
Passed 1196
Skipped 16
Total 1212

@jsoriano jsoriano merged commit 4d69683 into elastic:7.x Aug 14, 2020
@jsoriano jsoriano deleted the backport_20570_7.x branch August 14, 2020 09:50
@zube zube bot removed the [zube]: Done label Nov 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Team:obs-ds-hosted-services Label for the Observability Hosted Services team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants