Commit9b43e6793bremoved the PM_STARTUP shortcut that exited the postmaster directly when the startup process died, routing the case through HandleChildCrash() so that children processes running during PM_STARTUP are cleaned up rather than orphaned. However, HandleChildCrash() does nothing if FatalError is already set, and that is exactly the case while reinitializing after a crash: a relaunched startup process that dies before WAL redo starts would leave the state machine stuck at PM_STARTUP, preventing the postmaster to shut down. This issue is fixed by restoring the pre-9b43e6793b0f shortcut behavior: if FatalError is set when the startup process crashes, signal the remaining children and move to PM_NO_CHILDREN, so as the postmaster can properly exit with nothing orphaned. This is only reachable in v18 and newer versions, the early return of HandleChildCrash() on FatalError being introduced inf0b7ab7251. This issue has been reported on Windows, for a postmaster with its console gone. A trick to make InitPostmasterChild() fail aggressively was equally able to stuck a postmaster. Reported-by: Kuan-Ting Kuo <m0935388420@gmail.com> Author: Zexin Li <lizi.openmind@gmail.com> Discussion: https://postgr.es/m/19623-f9bd331940be1273@postgresql.org Backpatch-through: 18
PostgreSQL Database Management System
This directory contains the source code distribution of the PostgreSQL database management system.
PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This distribution also contains C language bindings.
Copyright and license information can be found in the file COPYRIGHT.
General documentation about this version of PostgreSQL can be found at https://www.postgresql.org/docs/19/. In particular, information about building PostgreSQL from the source code can be found at https://www.postgresql.org/docs/19/installation.html.
The latest version of this software, and related software, may be obtained at https://www.postgresql.org/download/. For more information look at our web site located at https://www.postgresql.org/.