Commit Graph

12 Commits

Author SHA1 Message Date
Scott Idem
bd035f8c17 fix(nginx,gunicorn): raise send_timeout and proxy_send_timeout for long-running endpoints
Nginx was closing the client connection after exactly 60 seconds on requests
like clip_video (ffmpeg, 5-40 min) because send_timeout and proxy_send_timeout
both default to 60s. proxy_read_timeout was already 2100s but the other two
timeouts were still at defaults.

With proxy_buffering off, Nginx holds the write path to the client open as soon
as the upstream connection is established. If the upstream sends no data for 60s
(e.g. ffmpeg processing), Nginx treats the idle write path as stalled and closes
the client connection, logging 499 (Client Closed Request).

Fixed: raise proxy_send_timeout and send_timeout to 2100s to match
proxy_read_timeout in the main location block.

Also raised the Gunicorn default timeout from 30s to 120s in gunicorn_conf.py
as a belt-and-suspenders measure (AE_API_GUNICORN_TIMEOUT env var takes precedence).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 14:05:22 -04:00
Scott Idem
6fd6899879 fix(gunicorn): set control_socket to /dev/shm path
Newer gunicorn (post-23.0.0) added _get_control_socket_path() which
calls os.path.isabs() on the value — crashing when it is None.
Point the socket to /dev/shm (already used for worker_tmp_dir) so it
is writable inside the container and satisfies the new gunicorn code.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 20:24:12 -04:00
Scott Idem
8c9d263afb Disable Gunicorn control_socket in FastAPI configs
Gunicorn 25.1.0+ enables a 'control_socket' by default, which creates
a root-owned 'gunicorn.ctl' file in the chdir directory. When this
directory is a volume mount (as in our dev/test setups), it causes
permission errors during Docker build context gathering.

This change explicitly sets 'control_socket = None' to prevent the
creation of this file.
2026-03-24 15:41:54 -04:00
Scott Idem
f886250ae3 Automation: Final robust DB restore fixes and updated gitignore rules. 2026-01-12 18:33:05 -05:00
Scott Idem
fc04c04044 Tweaks to get API to stop hanging? 2024-04-24 11:56:48 -04:00
Scott Idem
9262e9987e More work on configs and env 2023-09-08 14:23:08 -04:00
Scott Idem
cccf9fd24f Updates to make Docker Compose better 2023-09-08 13:13:01 -04:00
Scott Idem
7679a62cf1 General improvements. 2023-07-12 15:39:45 -04:00
Scott Idem
37c346efd7 Less configs to worry about 2023-06-13 17:11:35 -04:00
Scott Idem
7bdfe41aa1 Unknown 2023-04-16 19:45:11 -04:00
Scott Idem
70db400290 General updates and clean up. 2023-04-04 20:12:06 -04:00
Scott Idem
cc767aac25 Initial commit 2023-02-22 16:40:16 -05:00