[#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.
blacklight added 18 commits 2023-08-15 11:42:07 +02:00
827b564006
Using a single constant for DEFAULT_REDIS_QUEUE.
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.
b1f244a812
Added `ControllableProcess` class.
This class can be used to easily control the execution of underlying
processes.
06111587f7
Added `CommandStream` class.
This abstraction is used to write and read commands over a UNIX socket.
8819a0ed4c
Added `CommandStream` to the main `Application`.
The stream will be used to communicate command messages from the
application to its runner.
ceb9d6d1ba
Removed redundant `Backend._get_redis()` method.
It was used only once, and it could easily be replaced by
`platypush.utils.get_redis()`.
a8a7ceb2ac
Implemented `HttpBackend._stop_workers`.
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.
continuous-integration/drone/push Build is failing Details
00863a176e
Added `application` plugin.
blacklight added this to the core project 2023-08-15 11:42:16 +02:00
blacklight self-assigned this 2023-08-15 11:42:21 +02:00
blacklight added the
architecture
enhancement
labels 2023-08-15 11:42:35 +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 merged commit c2a17f0d75 into master 2023-08-15 21:34:44 +02:00
blacklight deleted branch 272/external-proc-controller 2023-08-15 21:34:44 +02:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: platypush/platypush#273
No description provided.