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 #19103 to 7.x: Stop counterCache only when already started #19240

Merged
merged 2 commits into from
Jun 24, 2020

Conversation

ChrsMark
Copy link
Member

@ChrsMark ChrsMark commented Jun 17, 2020

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

What does this PR do?

Adds a better handling for counterCache stop in order to avoid trying to stop a Janitor that is not yet started which will lead to panic errors. This will happen in cases where the Metricset is stopped before the first Fetch is called and hence the generator is not yet started:

m.once.Do(m.promEventsGen.Start)

In order to handle this properly we wait 2 periods (the fetching period of the metricset) until we try to stop the counterCache. If after 2 periods the generator is not marked as started then we just return in Stop without stoping the counterCache since this indicates that the metricset was stoped before the first Fetch.

Why is it important?

To avoid having panic crashes on Autodiscover scenarios.

Related issues

@ChrsMark ChrsMark added [zube]: In Review backport Team:Platforms Label for the Integrations - Platforms team labels Jun 17, 2020
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jun 17, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations-platforms (Team:Platforms)

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

elasticmachine commented Jun 17, 2020

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #19240 updated]

  • Start Time: 2020-06-24T06:41:12.226+0000

  • Duration: 72 min 3 sec

Test stats 🧪

Test Results
Failed 0
Passed 2560
Skipped 587
Total 3147

Steps errors

Expand to view the steps failures

  • Name: Install Go 1.13.10
    • Description: .ci/scripts/install-go.sh

    • Duration: 0 min 18 sec

    • Start Time: 2020-06-24T07:06:16.501+0000

    • log

@ChrsMark ChrsMark merged commit e8e0263 into elastic:7.x Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Team:Platforms Label for the Integrations - Platforms team [zube]: Done
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants