Skip to content

Label Reflex compiler and server processes by role - #7655

Open
Akarshkushwaha wants to merge 2 commits into
reflex-dev:mainfrom
Akarshkushwaha:codex/label-reflex-processes
Open

Akarshkushwaha wants to merge 2 commits into
reflex-dev:mainfrom
Akarshkushwaha:codex/label-reflex-processes

Conversation

@Akarshkushwaha

Copy link
Copy Markdown

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.

@Akarshkushwaha
Akarshkushwaha requested review from a team and Alek99 as code owners October 25, 2026 18:50
@greptile-apps

greptile-apps Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; both previous findings are addressed and no new actionable issues were found.

Summary

Labels compiler and Granian server processes by role so they are easier to identify in process listings.

  • Reflex child processes show their compiler, backend, or frontend role.

Reviews (2) · Last reviewed commit: "Address process title review feedback" · Reviewed by Greptile

Comment thread docs/hosting/self-hosting.md Outdated
Comment thread reflex/utils/processes.py Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 10 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="reflex/utils/exec.py">

<violation number="1" location="reflex/utils/exec.py:485">
P2: The frontend title is only passed in the Granian branch; the Uvicorn fallback starts a plain `gunicorn`/`uvicorn` command, so standalone frontend processes remain unlabeled when that fallback is selected. Apply the frontend role title to the fallback too.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

Comment thread reflex/utils/exec.py
port,
loglevel,
app_target=f"{__name__}:_frontend_prod_app",
process_name=processes.get_process_title("frontend"),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The frontend title is only passed in the Granian branch; the Uvicorn fallback starts a plain gunicorn/uvicorn command, so standalone frontend processes remain unlabeled when that fallback is selected. Apply the frontend role title to the fallback too.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At reflex/utils/exec.py, line 485:

<comment>The frontend title is only passed in the Granian branch; the Uvicorn fallback starts a plain `gunicorn`/`uvicorn` command, so standalone frontend processes remain unlabeled when that fallback is selected. Apply the frontend role title to the fallback too.</comment>

<file context>
@@ -472,11 +472,17 @@ def run_frontend_prod(host: str, port: int):
+            port,
+            loglevel,
+            app_target=f"{__name__}:_frontend_prod_app",
+            process_name=processes.get_process_title("frontend"),
         )
     else:
</file context>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Label reflex child processes in ps (e.g. reflex run [compiler])

1 participant