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

Immediately kill workers to prevent straglers #4744

Merged
merged 2 commits into from
Aug 25, 2015

Conversation

spalger
Copy link
Contributor

@spalger spalger commented Aug 25, 2015

Fixes #4737

Each Worker currently listens for the process "exit" event and attempts to kill it's child process to prevent leaving stragler processes. This was implemented by calling fork.kill(), which I assumed to work like process.kill(), but unfortunately it is async and doesn't send SIGTERM to the process in the same tick (a requirement of process "exit" listeners).

This fixes the implementation by switching to fork.process.exit(), which synchronously sends SIGTERM.

To replication steps from #4737:

  1. delete your optimize/bundles directory

  2. create an empty file at optimize/bundles/webpack.records

  3. in a console tab, run this script to repeatedly log the iojs process list

    while [ 1 ]; do ps | grep iojs; sleep 1; clear; done
  4. in another console tab run the kibana server in dev mode

    ./bin/kibana --dev
  5. observe the server logging optimizer crashed with status code 1 and the process list growing by one each time you do _#_4

  6. Finally killall iojs

2015-08-24 18_50_49

@jbudz
Copy link
Member

jbudz commented Aug 25, 2015

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Server stays running on exit, restart
2 participants