From 67bc69caaa22585ea94bf15023c1f63835d4b029 Mon Sep 17 00:00:00 2001 From: Ross McFarland Date: Mon, 10 Aug 2026 12:53:54 -0700 Subject: [PATCH 1/2] Update requirements.txt --- requirements.txt | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/requirements.txt b/requirements.txt index 40602c3..2881f06 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,22 +1,23 @@ # DO NOT EDIT THIS FILE DIRECTLY - use ./script/update-requirements to update x-python-version-not-supported; python_version!='3.10' and python_version!='3.11' and python_version!='3.12' and python_version!='3.13' and python_version!='3.14' -anyio==4.14.1 -asgiref==3.11.1 +anyio==4.14.2 +asgiref==3.12.1 black==26.5.1 build==1.5.0 -certifi==2026.6.17 -cffi==2.0.0 -charset-normalizer==3.4.7 +certifi==2026.7.22 +cffi==2.1.1 +charset-normalizer==3.4.9 click==8.4.2 cron-validator==1.0.8 -cryptography==49.0.0 -django==5.2.16 -django-debug-toolbar==6.3.0 +cryptography==50.0.0 +defusedxml==0.8.0rc2 +django==5.2.17 +django-debug-toolbar==7.1.0 exceptiongroup==1.3.1; python_version=='3.10' gunicorn==26.0.0 h11==0.16.0 hishel==1.3.0 -holidays==0.99 +holidays==0.103.dev20260808182958 httpcore==1.0.9 httpx==0.28.1 idna==3.18 @@ -25,11 +26,11 @@ joblib==1.5.3 mock==5.2.0 msgpack==1.2.1 mypy-extensions==1.1.0 -mysql-connector-python==9.7.0 -nltk==3.10.0 -packaging==26.2 +mysql-connector-python==26.7.0 +nltk==3.10.2 +packaging==26.3 pathspec==1.1.1 -platformdirs==4.10.0 +platformdirs==4.11.2 proviso==0.3.0 pycodestyle==2.14.0 pycparser==3.0 @@ -38,18 +39,18 @@ pylev==1.4.0 pyproject-hooks==1.2.0 python-dateutil==2.9.0.post0 pytokens==0.4.1 -pytz==2026.2 -regex==2026.5.9 +pytz==2026.3.post1 +regex==2026.7.19 requests==2.34.2 resolvelib==1.2.1 -setuptools==83.0.0 +setuptools==84.0.0 six==1.17.0 -slack-bolt==1.28.0 -slack-sdk==3.42.0 +slack-bolt==1.30.0 +slack-sdk==3.43.0 sqlparse==0.5.5 tomli==2.4.1; python_version=='3.10' -tqdm==4.68.3 -typing-extensions==4.16.0rc2 +tqdm==4.70.0 +typing-extensions==4.16.0 unearth==0.18.2 urllib3==2.7.0 word2number==1.1 From 946ded55ddc8f4fa18f84be31b318f015b5b5906 Mon Sep 17 00:00:00 2001 From: Ross McFarland Date: Mon, 10 Aug 2026 13:22:37 -0700 Subject: [PATCH 2/2] Add a connect_timeout for MySQL connections mysql-connector-python defaults connect_timeout to None (no timeout at all). CONN_MAX_AGE=300 means most requests reuse an existing connection, but the *first* one -- opened by a freshly forked gunicorn worker, or by the Cron thread's first tick -- has nothing to reuse. If that connection attempt stalls for any reason, the calling thread hangs forever with nothing logged, which matches the current 499s: the container logs show "Cron run: starting" (the first line of Cron.run(), before it touches the DB) and then nothing else at all, ever. This doesn't tell us *why* the connection is stalling, but it stops it from hanging silently -- a stuck attempt will now fail loudly and fast, get logged, and let the worker (or Cron's next tick) recover instead of being wedged permanently. Prime suspect for the underlying stall: mysql-connector-python has no upper-bound version constraint in pyproject.toml (unlike Django's <6.0), and this branch's requirements.txt regen jumped it from 9.7.0 to 26.7.0 in one shot -- by far the largest version delta of anything in that diff, and the one piece that actually talks to the real MariaDB server on every request. Worth pinning down/back if the timeout reveals a connection failure rather than just occasional slowness. --- simone/settings/dev.py | 4 ++++ simone/settings/prod.py | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/simone/settings/dev.py b/simone/settings/dev.py index c52ce13..c45e7ef 100644 --- a/simone/settings/dev.py +++ b/simone/settings/dev.py @@ -19,6 +19,10 @@ 'HOST': environ['SIMONE_DB_HOST'], 'PORT': environ.get('SIMONE_DB_PORT', '3306'), 'CONN_MAX_AGE': 300, + # See prod.py: mysql-connector-python has no connect timeout by + # default, so a stalled connection attempt hangs forever with + # nothing logged instead of failing loudly. + 'OPTIONS': {'connect_timeout': 10}, } } else: diff --git a/simone/settings/prod.py b/simone/settings/prod.py index a99134b..db1ea38 100644 --- a/simone/settings/prod.py +++ b/simone/settings/prod.py @@ -33,6 +33,12 @@ def _require_secret(name): 'HOST': environ['SIMONE_DB_HOST'], 'PORT': environ.get('SIMONE_DB_PORT', '3306'), 'CONN_MAX_AGE': 300, + # mysql-connector-python's own default is connect_timeout=None, i.e. + # no timeout at all -- a stalled handshake for a new connection (the + # first thing a freshly forked worker or the Cron thread does) hangs + # the calling thread forever with nothing logged. Fail loud and fast + # instead. + 'OPTIONS': {'connect_timeout': 10}, } }