StayPresent v1.5.15 fixes non-deterministic exit codes caused by thread scheduling
StayPresent, an open-source Python library for supervising long-running bots and background services, contained a bug where identical failures could produce different process exit codes across runs. The issue stemmed from the framework selecting its exit code based on whichever monitor thread inserted its failure entry into a dictionary first, making the outcome dependent on OS thread scheduling rather than application logic. This made debugging and automation unreliable, as CI systems and shell scripts depend on consistent, predictable exit codes. The fix, released in version 1.5.15, replaces insertion-order selection with a deterministic rule that always picks the exit code of the lowest-indexed failed bot. This aligns exit-code behavior with the already-sorted failure summary log, ensuring consistent output regardless of thread timing.
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