[#272] Support for external stop/restart control on the application #273

Merged
blacklight merged 18 commits from 272/external-proc-controller into master 2023-08-15 21:34:44 +02:00
Owner

This adds the application.stop and application.restart actions.

It also greatly improves the stability of the stop mechanism, preventing many race conditions on application stop that could result in zombie processes.

This adds the `application.stop` and `application.restart` actions. It also greatly improves the stability of the stop mechanism, preventing many race conditions on application stop that could result in zombie processes.
Also, catch `AttributeError` on `self._proc.terminate` in the
`HttpBackend`, since the process may already have been terminated and
set to null by another worker process.
This class can be used to easily control the execution of underlying
processes.
This abstraction is used to write and read commands over a UNIX socket.
The stream will be used to communicate command messages from the
application to its runner.
It was used only once, and it could easily be replaced by
`platypush.utils.get_redis()`.
The Tornado WSGI container won't guarantee the termination of the
spawned workers upon termination, so the code of the backend has to take
care of it and terminate all the children processes of the server
process when it terminates.

This also means that `psutil` is now a required base dependency, as we
need to expand the process subtree under the webserver launcher.
Added application plugin.
Some checks failed
continuous-integration/drone/push Build is failing
00863a176e
Alpine Linux requires the linux-headers package to build psutil.
All checks were successful
continuous-integration/drone/push Build is passing
fef6513cc8
blacklight added this to the core project 2023-08-15 11:42:16 +02:00
blacklight changed title from WIP: [#272] Support for external stop/restart control on the application to [#272] Support for external stop/restart control on the application 2023-08-15 21:34:26 +02:00
blacklight deleted branch 272/external-proc-controller 2023-08-15 21:34:44 +02:00
Sign in to join this conversation.
No description provided.