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

[kbn/optimizer] poll parent process to avoid zombie processes #67059

Merged
merged 6 commits into from
May 20, 2020

Conversation

spalger
Copy link
Contributor

@spalger spalger commented May 19, 2020

We're doing some debugging, trying to find potential explanations for why the memory usage of the optimizer on relatively beefy machines seems to be way higher than expected. Part of that debugging lead to realizing that zombie workers still seems possible, so this PR adds a polling mechanism to workers that will ask the parent process to send pongs back every 5 seconds or so. If a response is not received within 5 second the worker will exit. Additionally, if the "disconnect" event is observed in the worker, or the process.connected or process.send properties are set to falsy values, the worker will also exit.

@tylersmalley
Copy link
Contributor

Definitely seeing the child processes cleaned up with this.

@spalger spalger marked this pull request as ready for review May 20, 2020 04:27
@spalger spalger requested a review from a team as a code owner May 20, 2020 04:27
@spalger spalger added release_note:skip Skip the PR/issue when compiling release notes Team:Operations Team label for Operations Team v7.8.0 v7.9.0 v8.0.0 labels May 20, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@tylersmalley
Copy link
Contributor

tylersmalley commented May 20, 2020

If you don't foresee any issues, I think we should also backport to 7.7 to ensure we don't run into this down the road if we ever have to release another 7.7 build or for plugin authors.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@spalger spalger added the v7.7.1 label May 20, 2020
@spalger spalger merged commit e824ac3 into elastic:master May 20, 2020
spalger pushed a commit to spalger/kibana that referenced this pull request May 20, 2020
spalger pushed a commit to spalger/kibana that referenced this pull request May 20, 2020
spalger pushed a commit to spalger/kibana that referenced this pull request May 20, 2020
jloleysens added a commit to jloleysens/kibana that referenced this pull request May 20, 2020
…ent/add-support-in-url-for-hidden-toggle

* 'master' of github.com:elastic/kibana: (49 commits)
  [Uptime] Improve responsiveness details page (elastic#67034)
  skip flaky suite (elastic#66669)
  Revert "Integration of a static filesystem for the node_modules (elastic#47998)" (elastic#67124)
  Support api_integration/kibana/stats against remote hosts (elastic#53000)
  chore(NA): add module name mapper for src plugins on x-pack (elastic#67103)
  Change the error message on TSVB in order to be more user friendly (elastic#67090)
  [kbn/optimizer] poll parent process to avoid zombie processes (elastic#67059)
  [Visualize] Lazy load default editor, fix duplicated styles (elastic#66732)
  Bump styled-component dependencies (elastic#66611)
  Bump react-markdown dependencies (elastic#66615)
  Fix Core docs links (elastic#66977)
  Timelion graph is not refreshing content after searching or filtering (elastic#67023)
  Remove `--xpack.endpoint.enabled=true` from README.md file (elastic#67053)
  Move apm tutorial from apm plugin into apm_oss plugin (elastic#66432)
  [Logs UI] Restore call to `UsageCollector.countLogs` (elastic#67051)
  Remove unused license check result from LP Security plugin (elastic#66966)
  [Saved Objects] adds support for including hidden types in saved objects client (elastic#66879)
  [Discover] Deangularize timechart header (elastic#66532)
  [Discover] Improve and unskip a11y context view test (elastic#66959)
  [SIEM] Refactor Timeline.timelineType draft to Timeline.status draft (elastic#66864)
  ...

# Conflicts:
#	x-pack/plugins/index_management/__jest__/client_integration/helpers/home.helpers.ts
gmmorris added a commit to gmmorris/kibana that referenced this pull request May 21, 2020
* master:
  [apm] Annotation API documentation (elastic#65963)
  [Uptime] Improve responsiveness details page (elastic#67034)
  skip flaky suite (elastic#66669)
  Revert "Integration of a static filesystem for the node_modules (elastic#47998)" (elastic#67124)
  Support api_integration/kibana/stats against remote hosts (elastic#53000)
  chore(NA): add module name mapper for src plugins on x-pack (elastic#67103)
  Change the error message on TSVB in order to be more user friendly (elastic#67090)
  [kbn/optimizer] poll parent process to avoid zombie processes (elastic#67059)
  [Visualize] Lazy load default editor, fix duplicated styles (elastic#66732)
  Bump styled-component dependencies (elastic#66611)
  Bump react-markdown dependencies (elastic#66615)
  Fix Core docs links (elastic#66977)
  Timelion graph is not refreshing content after searching or filtering (elastic#67023)
  Remove `--xpack.endpoint.enabled=true` from README.md file (elastic#67053)
  Move apm tutorial from apm plugin into apm_oss plugin (elastic#66432)
  [Logs UI] Restore call to `UsageCollector.countLogs` (elastic#67051)
  Remove unused license check result from LP Security plugin (elastic#66966)
gmmorris added a commit to gmmorris/kibana that referenced this pull request May 21, 2020
* master: (21 commits)
  [Alerting] Hides the `alert` SavedObjects type (elastic#66719)
  skip flaky suite (elastic#66869)
  fix visual baseline tests
  [kbn/optimizer] require fsevents on macos (elastic#67147)
  [APM] Fix obscured service map connections (elastic#67129)
  [apm] Annotation API documentation (elastic#65963)
  [Uptime] Improve responsiveness details page (elastic#67034)
  skip flaky suite (elastic#66669)
  Revert "Integration of a static filesystem for the node_modules (elastic#47998)" (elastic#67124)
  Support api_integration/kibana/stats against remote hosts (elastic#53000)
  chore(NA): add module name mapper for src plugins on x-pack (elastic#67103)
  Change the error message on TSVB in order to be more user friendly (elastic#67090)
  [kbn/optimizer] poll parent process to avoid zombie processes (elastic#67059)
  [Visualize] Lazy load default editor, fix duplicated styles (elastic#66732)
  Bump styled-component dependencies (elastic#66611)
  Bump react-markdown dependencies (elastic#66615)
  Fix Core docs links (elastic#66977)
  Timelion graph is not refreshing content after searching or filtering (elastic#67023)
  Remove `--xpack.endpoint.enabled=true` from README.md file (elastic#67053)
  Move apm tutorial from apm plugin into apm_oss plugin (elastic#66432)
  ...
spalger added a commit that referenced this pull request May 22, 2020
@spalger spalger deleted the fix/kbn-optimizer/zombie-workers branch May 22, 2020 03:53
spalger added a commit to spalger/kibana that referenced this pull request May 22, 2020
spalger added a commit to spalger/kibana that referenced this pull request May 22, 2020
spalger added a commit to spalger/kibana that referenced this pull request May 22, 2020
spalger added a commit that referenced this pull request May 23, 2020
* Revert "[7.7] [kbn/optimizer] remove disconnect listener (#67161) (#67185)"

This reverts commit a1c7cf1.

* Revert "[7.7] [kbn/optimizer] poll parent process to avoid zombie processes (#67059) (#67119)"

This reverts commit e6a5a9d.

Co-authored-by: spalger <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>
mistic added a commit that referenced this pull request May 26, 2020
…esses (#67059) (#67262)

* chore(NA): revert changes introduced on pr 67059

* chore(NA): fix eslint problems
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes reverted Team:Operations Team label for Operations Team v7.7.1 v7.8.0 v7.9.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants