Label Reflex compiler and server processes by role

AK
8h ago
+224-5

Closes #7643.

Reflex child processes currently appear in process listings with repeated command lines or multiprocessing bootstrap arguments, making them difficult to tell apart.

This change labels the compiler, Granian backend, and standalone production frontend by role. For example, ps now shows reflex run [compiler], reflex run [backend], and reflex run [backend] worker-1.

It enables Granian's pname extra and builds titles independently of sys.argv so they work with spawned processes. Regression tests, deployment documentation, and a changelog fragment are included.

All Submissions:

  • Have you followed the guidelines stated in CONTRIBUTING.md file?
  • Have you checked to ensure there aren't any other open Pull Requests for the desired changed?

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

New Feature Submission:

  • Does your submission pass the tests?
  • Have you linted your code locally prior to submission?

Changes To Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Validation

  • Focused unit tests: 147 passed, 11 skipped.
  • Verified actual Linux process titles through WSL: compiler labels with fork, spawn and forkserver; development and production server labels with fork and spawn.
  • Confirmed the parent process title remains unchanged.
  • Full unit run: 12,372 passed, with one temporary-directory-related failure that passed when rerun outside the repository. Coverage was 80.36%.
  • Formatting, lint, spelling, stub generation and ty checks passed.
  • Verified process-name support with Granian 2.7.4, the minimum supported version.

Remaining validation limitations

The overall checkboxes above are left unchecked because these checks are not fully green locally:

  • Repository-wide Pyright reports 40 errors also present on the unchanged baseline. The pre-commit Pyright hook reports existing Windows errors for POSIX APIs in test_reflex.py.
  • The minimum-dependency check fails while building reflex-components-core because of an import error, also reproduced on the unchanged baseline.

macOS was not tested locally. Windows Task Manager command lines remain unchanged, as noted in the issue.