Eight merged PRs across patroni this week — mostly lifecycle and compatibility work, no releases.
*A 200ms network hiccup no longer demotes your primary.*
Patroni used to pull the failover trigger the moment a heartbeat gap appeared, even fleeting ones. @cyberdem0n's #3453 adds a primary race backoff — now a brief network stutter doesn't declare the leader dead. The delay sits in the leader race detection path, buying time before the cluster panics and promotes a replica.
*Patroni stops going blind when the store is temporarily unreachable.*
The Unavailable exception from etcd v3 was propagating uncaught, leaving patroni without cluster state visibility during transient store outages. #3562 catches and handles it properly. Now patroni degrades gracefully when the consensus store hiccups instead of crashing blind.
*The shutdown sequence was demoting threads while they were still needed.*
#3569 reorders patroni's shutdown lifecycle — the global thread pool now terminates after everything else has finished. Before, other components tried to schedule work on a pool that was already dead, causing silent failures during shutdown.
*Internal threading behavior shifted; patroni adapts.*
Python 3.11+ changed how the threading module works internally, breaking some of patroni's assumptions about thread lifecycle. #3526 adds compatibility logic to handle the new behavior. Patroni users on newer Python versions no longer encounter threading-related failures.
*Config errors surface immediately instead of at runtime.*
#3568 adds validation that postgresql.parameters is a dictionary. Malformed configs that sneak past the parser now fail early with a clear error message instead of causing cryptic failures later.
*Custom bootstrap scripts now run unmolested.*
Patroni was reloading the PostgreSQL configuration while a custom bootstrap was mid-flight, interfering with the bootstrap process. #3563 defers config reload until after bootstrap completes. Custom initialization scripts now execute without interruption.
*Lazy initialization reduces startup time.*
#3571 defers CitusHandler initialization until it's actually required. The change trims startup overhead for installations not using Citus.
*Test suite speeds up, latency gone.*
#3570 removes direct time.sleep() calls from unit tests. Tests that were burning real wall-clock time now run instantly, making the test suite faster and less flaky.
Your GitHub week, turned into something worth reading.
Generate your dispatch →