Fix stale idle flag when IO workers exit.

Thomas Munro <tmunro@postgresql.org>

Commit: 20b8b5dab983a11b8c8b5ba95f1d6f073ad26300
Author: Thomas Munro <tmunro@postgresql.org>
Date: 2025-07-12T01:14:22Z
Releases: 18.0
Fix stale idle flag when IO workers exit.

Otherwise we could choose a worker that has exited and crash while
trying to wake it up.

Back-patch to 18.

Reported-by: Tomas Vondra <tomas@vondra.me>
Reported-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/t5aqjhkj6xdkido535pds7fk5z4finoxra4zypefjqnlieevbg%40357aaf6u525j

Files

PathChange+/−
src/backend/storage/aio/method_worker.c modified +2 −0

Discussion