StayPresent v1.5.10 Fixes Race Condition That Left Bot Processes Running After Shutdown
A shutdown race condition was discovered and patched in StayPresent, an open-source Python library that supervises bots and background services on platforms like Render, Railway, and Heroku. The bug occurred when a supervised bot crashed and the monitor thread entered an uninterruptible sleep during the restart delay; if a shutdown signal arrived in that window, the monitor could still spawn a new bot process after cleanup had already completed. Because monitor threads are non-daemon, this could cause the application to hang indefinitely waiting for a process that should never have been created. The fix, released in v1.5.10, replaces the uninterruptible sleep with an interruptible wait and synchronizes the respawn logic with the shutdown sequence so no new processes can be created once termination begins. The patch preserves the existing public API and restart behavior while ensuring shutdown always takes priority over process restarts.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in