aiotools icon indicating copy to clipboard operation
aiotools copied to clipboard

server: graceful reload and restart via SIGHUP/SIGUSR1 signals

Open achimnol opened this issue 8 years ago • 1 comments

  • Graceful reload: when the main program receives SIGUSR1, let it shutdown all workers and extra processes, call a restart callback, and re-spawn all workers and extra processes again. A restart callback is intended to read the (changed) configuration again, which is written by the user.
  • Graceful restart: when the main program receives SIGHUP, let it terminate completely and re-execute the whole process again, preferably with the same sys.argv and environment variables. Add an optional restart callback which is called after terminating workers but before calling user-defined main exit handler.

There may be required several design decision on what arguments to pass to callbacks and when to call them. Let's discuss and implement.

achimnol avatar Aug 14 '17 06:08 achimnol

https://github.com/achimnol/aiotools/pull/9

Suckzoo avatar Aug 15 '17 08:08 Suckzoo