Tanmoy Sarkar 104bfcebdd feat(companion): Add Unix control socket and JSON command protocol
Add gunicorn/companion/control.py with ControlServer, the manager's control
endpoint. It owns the Unix socket lifecycle (create unlinks any stale socket,
binds, chmods 0o600, and listens; close cleans up) and the newline-delimited
JSON framing: serve_connection buffers reads and answers each complete line.
decode_command parses a request into a JSON object carrying a string cmd, and
encode_response writes a newline-terminated JSON line; malformed input becomes
a CommandError rendered as an {ok: false, error: ...} reply so a bad client
can't take the manager down. Turning a command into an action is delegated to a
dispatch callable, wired up in the later command tasks.

The socket is 0o600 and owned by the non-root user gunicorn runs as; no group
switching.

Add tests/test_companion_control.py covering decode, encode, handle_line
dispatch and error envelopes, and socket create/close.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 18:23:03 +05:30
..
2014-03-31 11:14:45 -07:00
2024-08-10 22:34:28 +02:00
2024-08-10 22:34:28 +02:00
2023-05-11 17:45:57 +03:00
2012-10-03 05:04:07 +05:45
2024-07-31 04:18:20 +02:00

Generate Documentation
======================

Requirements
------------

To generate documentation you need to install:

 - Python >= 3.7
 - Sphinx (https://www.sphinx-doc.org/)


Generate html
-------------
::

    $ make html

The command generates html document inside ``build/html`` dir.