Skip to content

Production runs uvicorn with --reload, and has 12 uncommitted files #149

Description

@saqibmanan

The production backend runs uvicorn with --reload:

$ docker inspect DataSpace --format '{{.Config.Cmd}}'
[uvicorn DataSpace.asgi:application --host 0.0.0.0 --port 8000 --reload]

--reload is a development flag. It starts a file-watching supervisor that
restarts the server whenever a source file changes, and it is documented by
uvicorn as not for production use.

Why it matters here

  • It disables multiple workers. --reload and --workers are mutually
    exclusive, so prod is stuck at one worker regardless of configuration. Dev now
    runs two (#135).
  • It watches the filesystem continuously, costing CPU and file handles for
    a capability nothing in production needs.
  • A stray file write restarts the auth-serving API. There are currently 12
    uncommitted files in the prod checkout; anything touching them cycles the app.

Also observed on the same box

The working tree at ~/DataExchange/DataExBackend has 12 uncommitted files.
An image-based deploy would discard them silently. They need to be diffed and
either committed or consciously dropped before any pipeline work — otherwise the
first automated deploy is also an unplanned rollback of whatever they contain.

Fix

Remove --reload in the same change that introduces workers. Doing one without
the other is worse than neither: workers without removing reload has no effect,
and removing reload without workers leaves prod single-threaded.

Related: #141,
#142.
Read-only survey; nothing was changed on the box.

Activity

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions