Skip to content

Commit 1d3d0c9

Browse files
committed
Set PYTHONFAULTHANDLER so we get a traceback on crash
1 parent adce080 commit 1d3d0c9

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

api/run.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ fi
127127
# Temporary: Turn off python buffering or debug output made by print() may not show up in logs
128128
export PYTHONUNBUFFERED=1
129129

130+
# Print the Python traceback of the crashing thread if the interpreter dies on a
131+
# fatal signal (e.g. segfault), so crashes are diagnosable from the service logs
132+
export PYTHONFAULTHANDLER=1
133+
130134
UVICORN_WORKERS=${TFL_UVICORN_WORKERS:-1}
131135

132136
echo "▶️ Running one-time startup tasks before workers"

0 commit comments

Comments
 (0)