Metaculus / Metaculus/metaculus

Gunicorn workers auto-restart 502 nginx

Open
#3,395 1 comment 0 reactions 1 assignee View on GitHub

@hlbmtc is already working on this.

Since Sep 1, 2025.

Stale Technical
Dominant language
TypeScript
Stars
113
Forks
34
Avg merge
16h 34m
Merged PRs (30d)
30

Description

All these 502 errors are related to this PR, which introduced auto-restarting of Gunicorn workers every 1.5k requests. I had expected this to be good practice — to periodically free up allocated resources and guard against potential memory leaks — but it’s not working as I hoped.

I assumed Gunicorn would re-route traffic to other active workers during a restart so users wouldn’t notice, but it seems like it's actually throwing 502s during the restart window instead.

Investigate how to avoid 502 errors

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.