Skip to content

prodeng-605: migrate uwsgi to granian#7566

Merged
gi0baro merged 6 commits into
masterfrom
gi0baro/drop-uwsgi
Jan 14, 2026
Merged

prodeng-605: migrate uwsgi to granian#7566
gi0baro merged 6 commits into
masterfrom
gi0baro/drop-uwsgi

Conversation

@gi0baro

@gi0baro gi0baro commented Dec 2, 2025

Copy link
Copy Markdown
Member

SSIA

@linear

linear Bot commented Dec 2, 2025

Copy link
Copy Markdown

@gi0baro
gi0baro force-pushed the gi0baro/drop-uwsgi branch 3 times, most recently from aa68515 to f9079b5 Compare December 2, 2025 14:33
@gi0baro
gi0baro force-pushed the gi0baro/drop-uwsgi branch from a963e77 to b260d35 Compare January 12, 2026 13:40
@gi0baro
gi0baro marked this pull request as ready for review January 12, 2026 13:41
@gi0baro
gi0baro requested a review from a team as a code owner January 12, 2026 13:41
Comment thread snuba/cli/api.py
Comment thread snuba/utils/server.py
interface=Interfaces.WSGI,
backlog=backlog,
workers=processes,
workers_lifetime=lifetime,

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.

What does lifetime do, especially when None since we don't specify a value when we start the API? Don't we want the process to be recycled regularly due to our

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

When is None the workers have no max lifetime.
I'm not 100% sure we want a default value, also because we don't use the CLI command to run snuba on our side.

@gi0baro
gi0baro merged commit 9a5cfa8 into master Jan 14, 2026
34 checks passed
@gi0baro
gi0baro deleted the gi0baro/drop-uwsgi branch January 14, 2026 15:32
onewland added a commit that referenced this pull request May 7, 2026
Drop the `/tmp/snuba.down` drain mechanism, which has been a no-op since
the granian migration.

The mechanism worked by having a uwsgi worker consult `uwsgi.started_on`
and compare it to the down file's mtime. When we migrated from uwsgi to
granian in #7566, `pyuwsgi` was dropped from runtime deps and the
Dockerfile, so `import uwsgi` has always failed and
`check_down_file_exists()` has returned `False` ever since. I also
checked that nothing references this drain mechanism anymore (since
getsentry/ops#17972).

Removed:

- `snuba/utils/health_info.py`: the `try: import uwsgi` block,
`shutdown_time`, `_IS_SHUTTING_DOWN`, `_set_shutdown`, `get_shutdown`,
`check_down_file_exists`, and the `down_file_exists` field/tag in
`/health` output and metrics.
- `snuba/web/views.py`: the `check_shutdown` function (5%-sampled disk
check that was always no-op) and both call sites in `dataset_query` and
`storage_delete`.
- Tests for the above.

`/health_envoy` is **kept as a static 200 tombstone** so existing envoy
callers don't start 404'ing. Today the endpoint already always returns
200 (because `check_down_file_exists()` always returns `False`), so this
preserves runtime behavior. It can be removed in a follow-up once the
envoy-side config no longer references the path.

This is a prerequisite for the INC-2141 health-check change — that PR
will be opened against this branch and removes the side-effect that
surfaced the dead `import uwsgi` (mypy was newly resolving the import
inside `health_info.py` after #7566 dropped it from the type-stub
allowlist, blocking commits to that file).

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

2 participants