Limiting Execution Time Through Interrupt Driven Programming
summary
Gunicorn hard-kills workers at 30s so an earlier 28 second alarm triggers a handler that raises a Python exception, funnels full stack traces into Sentry and makes long runners visible. That exposes a repo-count bug; pagination is switched from offset to cursor and the expensive total-count is removed. A reusable interruptingcow library and Django time limit tag let code timebox work (examples: 100 ms for regex linkification, a one second quota for per-commit diffs) and reliably degrades partial results instead of collapsing.
AI-written summary · about
chapters (16)
- 0:00Intro
- 0:40Responsive Web Apps
- 0:55The Tweet
- 1:24Performance Dashboard
- 2:33Slow Requests
- 5:22Alarm Signal Handler
- 7:04Stack Traces
- 9:36Running in Constant Time
- 10:10Fixing Bad Code
- 10:43Environmental Issues
- 14:11Interrupting Cow
- 17:09Time Limit Tag
- 18:17Time Limit Code
- 18:39Unique Aspects
- 20:37Summary
- 21:26Questions
related talks
26mHow to avoid breaking other people's things
35mDo the holes in Swiss cheese leak abstractions?
51mDjangoCon 2008 Keynote: Mark Ramm
29mA Trip to the New Wild Wild West
37mAPI Horror Stories from an Unnamed Coworking Company
30mWhat are you yield from?
11mFix your hardest bugs with ease with Time Travel Debugging - Session Interview With Greg Law
25mAvoiding Overload in Distributed Systems
