Lyft engineers encountered and resolved a memory leak during a Python version upgrade from 3.8 to 3.10. The issue manifested as increased latency and frequent container restarts. The investigation involved using a custom memory profiling tool based on tracemalloc and identifying an incompatibility between gevent's monkey patching and urllib3's connection pooling, specifically related to weakref.finalize. Downgrading urllib3 to 1.26.15 resolved the issue. The post also details challenges with gunicorn's preload setting when using signal handlers.
All Lyft trails