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

app.stop does not exit the process #927

TobiasNickel opened this Issue Feb 23, 2017 · 0 comments


None yet
1 participant

TobiasNickel commented Feb 23, 2017

Hi, currently I want to make process, that allow me to restart server (for updates) with zero downtime.

for different servertypes I need different strategies. Important is a graceful shutdown of a server.

  1. one server that serves our main APIs should stop serving new requests, finish all started and shutdown (can be detected - done)
  2. a collaboration server that has state in the server need to sync that state first to db before shutdown(done)

so after I did that jobs I wanted the server process to shutdown them self.
I call app.stop();

I see the components stop methods get executed, the server-process cancel the connection to master (is not longer in pomelo list)
but the process does not terminate terminate.

I think there is a Bug in app.stop. I read the code carefully and debugged it.
The code is in game-server/node_modules/pomelo/lib/application.js (about line 429)

there is a stopTimer. when the components are stopped within 3 seconds the timer is stopped.
but the process is not exited.

I think the if(force){...} condition should be in the timers callback, and when the components are finished, the process should exit (0).

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