What fork() Actually Copies
9 hours ago
- #Celery Workers
- #Database Connections
- #Fork Safety
- A small configuration flag change in a Django/Celery setup caused all Celery workers to time out on database access.
- The issue stemmed from database connection pools being opened in the master process before fork(), leading to shared and corrupted resources in child processes.
- The proposed fix involves closing connections before fork() and ensuring each child creates its own independent pool.