Jump to solution
Verify

The Fix

Upgrade to version 0.22.0 or later.

Based on closed Kludex/uvicorn issue #1832 · PR/commit linked

Production note: Most teams hit this during upgrades or environment changes. Roll out with a canary and smoke critical endpoints (health, OpenAPI/docs) before 100%.

Jump to Verify Open PR/Commit
@@ -82,6 +82,8 @@ def __init__( def should_restart(self) -> Optional[List[Path]]: + self.pause() + changes = next(self.watcher)
repro.py
import sys import logging import uvicorn from fastapi import FastAPI app = FastAPI() logging.basicConfig( level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', stream=sys.stdout, ) logger = logging.getLogger('uvicorn') LOG_CONFIG = { 'version': 1, 'handlers': { 'console': { 'class': 'logging.StreamHandler', 'formatter': 'generic', } }, 'formatters': { 'generic': { 'format': '%(asctime)s [%(process)d] [%(levelname)s] %(message)s', 'datefmt': '[%Y-%m-%d %H:%M:%S]', 'class': 'logging.Formatter', } }, 'loggers': { 'uvicorn': { 'handlers': ['console'], 'level': 'INFO', 'propagate': False, }, } } @app.get('/') def read_root(): return {'Hello': 'World'} if __name__ == '__main__': uvicorn.run( '__main__:app', host='0.0.0.0', port=8000, reload=True, reload_delay=120.0, log_config=LOG_CONFIG )
verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
fix.md
Option A — Upgrade to fixed release\nUpgrade to version 0.22.0 or later.\nWhen NOT to use: This fix should not be used if the reload behavior is intended to be immediate.\n\n

Why This Fix Works in Production

  • Trigger: If I understand correctly, `uvicorn` should reload after 120s of file changes, but actually `uvicorn` seems to start reloading right away. (I can't tell if…
  • Mechanism: The WatchFilesReload class does not respect the reload_delay setting due to missing pause functionality
  • Why the fix works: Adds a pause method to the WatchFilesReload class, addressing the issue with the reload_delay setting not being respected. (first fixed release: 0.22.0).
Production impact:
  • If left unfixed, the same config can fail only in production (env differences), causing startup failures or partial feature outages.

Why This Breaks in Prod

  • The WatchFilesReload class does not respect the reload_delay setting due to missing pause functionality
  • Production symptom (often without a traceback): If I understand correctly, `uvicorn` should reload after 120s of file changes, but actually `uvicorn` seems to start reloading right away. (I can't tell if it's immediately or the default 0.25s)

Proof / Evidence

  • GitHub issue: #1832
  • Fix PR: https://github.com/kludex/uvicorn/pull/1930
  • First fixed release: 0.22.0
  • Reproduced locally: No (not executed)
  • Last verified: 2026-02-09
  • Confidence: 0.85
  • Did this fix it?: Yes (upstream fix exists)
  • Own content ratio: 0.45

Discussion

High-signal excerpts from the issue thread (symptoms, repros, edge-cases).

“I have taken a look into this issue and went through watchfiles docs and code”
@aminalaee · 2023-04-06 · confirmation · source
“sorry not to reply earlier. My instinct is that this is an oversight. The closest equivilant to reload_delay in watchfiles is debounce I think, see…”
@samuelcolvin · 2023-03-22 · source
“@samuelcolvin do you remember if this was on purpose?”
@Kludex · 2023-01-06 · source
“That is my understanding as well - watchfiles does not use the reload_delay setting”
@br3ndonland · 2023-01-05 · source

Failure Signature (Search String)

  • If I understand correctly, `uvicorn` should reload after 120s of file changes, but actually `uvicorn` seems to start reloading right away. (I can't tell if it's immediately or the
  • [2023-01-05 05:03:08] [24864] [INFO] Will watch for changes in these directories: ['D:\\code\\test']
Copy-friendly signature
signature.txt
Failure Signature ----------------- If I understand correctly, `uvicorn` should reload after 120s of file changes, but actually `uvicorn` seems to start reloading right away. (I can't tell if it's immediately or the default 0.25s) [2023-01-05 05:03:08] [24864] [INFO] Will watch for changes in these directories: ['D:\\code\\test']

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- If I understand correctly, `uvicorn` should reload after 120s of file changes, but actually `uvicorn` seems to start reloading right away. (I can't tell if it's immediately or the default 0.25s) [2023-01-05 05:03:08] [24864] [INFO] Will watch for changes in these directories: ['D:\\code\\test']

Minimal Reproduction

repro.py
import sys import logging import uvicorn from fastapi import FastAPI app = FastAPI() logging.basicConfig( level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', stream=sys.stdout, ) logger = logging.getLogger('uvicorn') LOG_CONFIG = { 'version': 1, 'handlers': { 'console': { 'class': 'logging.StreamHandler', 'formatter': 'generic', } }, 'formatters': { 'generic': { 'format': '%(asctime)s [%(process)d] [%(levelname)s] %(message)s', 'datefmt': '[%Y-%m-%d %H:%M:%S]', 'class': 'logging.Formatter', } }, 'loggers': { 'uvicorn': { 'handlers': ['console'], 'level': 'INFO', 'propagate': False, }, } } @app.get('/') def read_root(): return {'Hello': 'World'} if __name__ == '__main__': uvicorn.run( '__main__:app', host='0.0.0.0', port=8000, reload=True, reload_delay=120.0, log_config=LOG_CONFIG )

What Broke

Uvicorn reloads immediately instead of waiting for the specified reload_delay.

Why It Broke

The WatchFilesReload class does not respect the reload_delay setting due to missing pause functionality

Fix Options (Details)

Option A — Upgrade to fixed release Safe default (recommended)

Upgrade to version 0.22.0 or later.

When NOT to use: This fix should not be used if the reload behavior is intended to be immediate.

Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.

Fix reference: https://github.com/kludex/uvicorn/pull/1930

First fixed release: 0.22.0

Last verified: 2026-02-09. Validate in your environment.

Get updates

We publish verified fixes weekly. No spam.

Subscribe

When NOT to Use This Fix

  • This fix should not be used if the reload behavior is intended to be immediate.

Verify Fix

verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.

Did This Fix Work in Your Case?

Quick signal helps us prioritize which fixes to verify and improve.

Prevention

  • Capture the exact failing error string in logs and tests so you can reproduce via a minimal script.
  • Pin production dependencies and upgrade only with a reproducible test that hits the failing path.

Version Compatibility Table

VersionStatus
0.22.0 Fixed

Related Issues

No related fixes found.

Sources

We don’t republish the full GitHub discussion text. Use the links above for context.