Re: hang during shutdown - Mailing list pgsql-hackers

From Jakub Wartak
Subject Re: hang during shutdown
Date
Msg-id CAKZiRmxxD5y2hArj3p4Ueq2jvQoTUsUr7tjeK44OnSqxAD1ZmA@mail.gmail.com
Whole thread
In response to Re: hang during shutdown  (Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com>)
Responses Re: hang during shutdown
List pgsql-hackers
On Mon, Jul 6, 2026 at 8:30 AM Anthonin Bonnefoy
<anthonin.bonnefoy@datadoghq.com> wrote:
>
> Hi,
>
> On Sun, Jul 5, 2026 at 11:55 PM Jeremy Schneider
> <schneider@ardentperf.com> wrote:
> > so far, it all started with this postgres hang during a shutdown. we didnt capture enough diagnostics to root-cause
thedomino before the hang, but the data i do have about this postgres hang is very peculiar. i'm working on some
automationto gather more diagnostics if there is a recurrence. in the meantime i wanted to share what i do know, in
caseanyone else has seen something similar. 
> >
> > postgres version 16.13
> > Ubuntu 22.04.5 LTS
> > kernel 5.15.0-1110-azure
> >
> > between log messages and wal contents, it appears PostmasterStateMachine transitioned into PM_WAIT_BACKENDS but
neverprogressed beyond this for a full 30 minutes until external automation finally killed the processes. 
>
> Did you have an active logical replication stream at the time of the
> shutdown? If so, it's very likely due to a bug in the logical
> walsender[..]

Aren't walsenders in general problematic for shutdowns? (not just logical, of
course it might be this). The PG 19 is going to have
wal_sender_shutdown_timeout, and from description it seems to match [0] to
something like that. 'netstat -ntpo' would help to see from such hanged
system (if walsenders running there at this point at all).

-J.

[0] - https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=a8f45dee91768cf1447ffaf2527e499e75a194c3



pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: clean up size_t/ssize_t use with POSIX file system APIs
Next
From: Thomas Munro
Date:
Subject: Re: Can we get rid of TerminateThread() in pg_dump?