From 35e171fd35d25a480f659304a38253fce47d07b4 Mon Sep 17 00:00:00 2001 From: Tender Wang Date: Tue, 17 Mar 2026 13:10:13 +0800 Subject: [PATCH] Clarify HandleChildCrash comments and reference its call sites. The existing header comment for HandleChildCrash describes its actions but lacks context on which process exits are considered catastrophic. Instead of maintaining a volatile list of process names, this commit updates the comments to point to process_pm_child_exit() and CleanupBackend(). These functions encapsulate the logic for determining when a child's abnormal exit requires a cluster-wide restart. The core description of the function's objectives is preserved. --- src/backend/postmaster/postmaster.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index 3fac46c402b..196e47d01fc 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -2797,13 +2797,16 @@ HandleFatalError(QuitSignalReason reason, bool consider_sigabrt) } /* - * HandleChildCrash -- cleanup after failed backend, bgwriter, checkpointer, - * walwriter, autovacuum, archiver, slot sync worker, or background worker. + * HandleChildCrash -- process a crash of a child process. * * The objectives here are to clean up our local state about the child * process, and to signal all other remaining children to quickdie. * * The caller has already released its PMChild slot. + * + * The specific conditions and process types that trigger this are + * managed in process_pm_child_exit() (for auxiliary processes) + * and CleanupBackend() (for backends). */ static void HandleChildCrash(int pid, int exitstatus, const char *procname) -- 2.34.1