pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: WR <wolle321@freenet.de>
To: pgsql-general@lists.postgresql.org
Subject: Obsolete or dead serverconnections after reboot
Date: Wed, 21 Jul 2021 12:49:06 +0200
Message-ID: <9da9e765-9042-4f5e-00a1-4695d1244a47@freenet.de> (raw)

Hello community,

actually I have a problem wit PG13 on Windows 10 (both x64), Postgres 
version is 13.0.2.21090 from EDB installer.

I have to develop a logical replication cluster, where sometimes there 
happens a shutdown of one host. Logical replication works nice, thank 
you for that.

My issue is, when I do a normal Windows shutdown, when there are 
connections open to this database server and later this host comes up 
again in statistics I find the old connections from before shutdown. 
They don't go away and keep staying there over reboots. Only a restart 
of the Windows service throws them away.

The problem is, that they block a place in der connections counter of 
the server and after a while I cant login any more, because the maximum 
user-connection count is exceeded.

Example:
select pid, datid, application_name, usename , client_addr from 
pg_stat_activity;
before reboot (one active psql session, left it open on server shutdown):

   pid  | datid  | application_name | usename  |              client_addr
-------+--------+------------------+----------+---------------------------------------
  13548 | 156501 | psql             | postgres | 192.168.2.49

after reboot (and newly started psql session):

   pid  | datid  | application_name | usename  |              client_addr
-------+--------+------------------+----------+---------------------------------------
  13548 | 156501 | psql             | postgres | 192.168.2.49
  13764 | 156501 | psql             | postgres | 192.168.2.49

As we can see at pid column, the old connection is still there, but I 
have only on psql session open.

After restarting the postgres service( and psql reconnect):

   pid  | datid | application_name | usename  |              client_addr
-------+-------+------------------+----------+---------------------------------------
  12132 | 91805 | psql             | postgres | 192.168.2.49

Everything is like expected: one psql-session, one row in the statistics

Is there a way to avoid this (without restarting the service after every 
reboot). Is this a bug or a normal behavior?

Thank you,
Wolfgang

-- 
May the source be with you





view thread (15+ messages)  latest in thread

Message-ID: <9da9e765-9042-4f5e-00a1-4695d1244a47@freenet.de>
Permalink:  ../9da9e765-9042-4f5e-00a1-4695d1244a47@freenet.de/
Also on:    postgresql.org/message-id/9da9e765-9042-4f5e-00a1-4695d1244a47@freenet.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: wolle321@freenet.de
  Subject: Re: Obsolete or dead serverconnections after reboot
  In-Reply-To: <9da9e765-9042-4f5e-00a1-4695d1244a47@freenet.de>
  References: <9da9e765-9042-4f5e-00a1-4695d1244a47@freenet.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox