Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m6tlx-00087c-7X for pgsql-general@arkaria.postgresql.org; Fri, 23 Jul 2021 11:55:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m6tlv-0001fP-Fi for pgsql-general@arkaria.postgresql.org; Fri, 23 Jul 2021 11:55:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m6tlv-0001fH-3w for pgsql-general@lists.postgresql.org; Fri, 23 Jul 2021 11:55:19 +0000 Received: from mout1.freenet.de ([2001:748:100:40::2:3]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.92) (envelope-from ) id 1m6tlo-0001re-5i for pgsql-general@lists.postgresql.org; Fri, 23 Jul 2021 11:55:18 +0000 Received: from [195.4.92.119] (helo=sub0.freenet.de) by mout1.freenet.de with esmtpa (ID rissler.wolfgang@01019freenet.de) (port 25) (Exim 4.92 #3) id 1m6tll-0007dz-CG; Fri, 23 Jul 2021 13:55:09 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=freenet.de; s=mjaymdexmjqk; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=3o0gb4HDLSOaO2lxcW6kDQBWKJIVkapa3OWvCsOZc1c=; b=PslRzXIfGQZT7+sqtlkM+B3ujW QlLSD/UBkqrnLBtLOXPu148fWPqE0dQFMLE2lUvfz83z8C4x4PnPQrpIDeMTM2xbvbd87HaX3emqr 3RqJoKo8Vn7yHUNhrt62+r4HLGH2q0T6RJwspuReECFq9EZIr0GlDH2K5N/AQ193XpQ9SwnhQI9a3 0PwEBjwKcn0HxMcm7pRf0e9sC3lDSyE8afJpNLDb/Gf9b1n6Pj5z0xzvTCp8C/IE0B/8GVUAFJnng Dp4k2NsQgY92G0wf57JXxR6jRHqH9AQW38/8saRRVcNNURSc4C+4sWxwMnon/8sk9zxs9XieASWV4 jjgVNyYw==; Received: from p200300fc1f03f200346f7d59ea8038f5.dip0.t-ipconnect.de ([2003:fc:1f03:f200:346f:7d59:ea80:38f5]:51501) by sub0.freenet.de with esmtpsa (ID rissler.wolfgang@01019freenet.de) (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (port 465) (Exim 4.92 #3) id 1m6tll-0003iK-8N; Fri, 23 Jul 2021 13:55:09 +0200 Subject: Re: Obsolete or dead serverconnections after reboot To: Ninad Shah Cc: Vijaykumar Jain , pgsql-general References: <9da9e765-9042-4f5e-00a1-4695d1244a47@freenet.de> <32bb4b13-2ec1-91c6-4e1f-efa51cfd25c0@freenet.de> <864515f0-8009-cd89-85e1-e4e65391e092@freenet.de> From: WR Message-ID: Date: Fri, 23 Jul 2021 13:55:09 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 8bit X-Originated-At: 2003:fc:1f03:f200:346f:7d59:ea80:38f5!51501 X-FNSign: v=2 s=0DFA42E2F9414AA5C7E5775DA52853D4ACCA895089E9EF97AC46FA86C8308E90 X-Scan-TS: Fri, 23 Jul 2021 13:55:09 +0200 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello, unfortunately, it's my companys choice of OS. In private life I'm riding the penguin. One last thing: I have 2 Laptops, where the shutdown doesn't work, and one VirtualBox machine where it works like a charm. Maybe it has something to do with the power management. As a workaround I set the value idle_in_transaction_session_timeout to 5min. So the server kills this idle connections from before the power cycle (and all others too) after 5 minutes. Thank you, guys (PS.: still no answer from EDB) Am 22.07.2021 um 16:51 schrieb Ninad Shah: > Factually, Windows itself has a number of issues. Hence, it is always > suggested to use Linux with it. > > It can be explored further by querying the table from which > pg_stat_activity gathers data. > > > Regards, > Ninad Shah > > > On Thu, 22 Jul 2021 at 12:51, WR > wrote: > > Hello Ninad Shah, > > I think, nobody holds the connections, because the state is idle. But > I'm not shure what means: the connection is idle. > > One interesting fact was: when I dont stop the psql commandline on the > client (and dont start another query, wht ends up in a connection > reset, > while the server is down), psql uses the same connection after reboot > and the state goes from idle back to active. > > So there are two questions: what will happen to idle connctions after a > while, if the client doesnt exist anymore. > And is this desired behavior, the the postgres-Server-Service does > not a > shutdown on reboot on windows. (seem my mail to Vijaykumar Jain) > > Thanks you, Greeting from germany, > Wolfgang > > Am 21.07.2021 um 16:10 schrieb Ninad Shah: > > Hello, > > > > Would you be able to verify the process trees for those PIDs on > Windows? > > You may be able to see who holds the connections? > > > > > > Regards, > > Ninad Shah > > > > On Wed, 21 Jul 2021 at 19:15, WR > > >> wrote: > > > >     Hello Vijaykumar Jain, > > > >     thank you for fast answer, today I'm not able to access the > hardware, > >     I'll be back tomorrow and will do the required tests. > > > >     Wolfgang > > > >     Am 21.07.2021 um 15:14 schrieb Vijaykumar Jain: > >      > select pg_stat_reset(); > >      > > >      > Can you run above function, to check if stats are reset and > >     things are > >      > fine without a pg restart? > >      > I not able to understand how new connection stats are added, > >     along with > >      > old stale states, if I assume stats collector process is > having > >     issues , > >      > or the stats folder is corrupt etc. > >      > That would also mean, all table stats would be off or not > updated > >     too? > >      > Is that so? Or analyse works fine on tables without a restart? > >      > > >      > On Wed, Jul 21, 2021, 6:27 PM Vijaykumar Jain > >      > > >      > > >      > > >      >>> wrote: > >      > > >      > > >      > > >      >         Is there a way to avoid this (without restarting > the service > >      >         after every > >      >         reboot). Is this a bug or a normal behavior? > >      > > >      > > >      >     I have less knowledge of windows. > >      > https://www.enterprisedb.com/blog/postgresql-shutdown > > >      > > >      >      > >      >> > >      > > >      > > >      > > >      >     Do you see shutdown/termination messages in the db logs or > >     windows > >      >     event logs when the machine is rebooted? > >      > > >      >     You get the same pid and query, does it also has the same > >     age( time > >      >     since it started), > >      >     I mean is the stats table updated with new data for stale > >      >     connections or they remain static. > >      > > >      >     Do you see the same issue when the machine is power > cycled. > >      > > >      >     Maybe windows might be preserving the memory state on > disk and > >      >     reading it back on reboot (like sleep) unless there are > >     instructions > >      >     to shutdown the db server on reboot. Idk. > >      > > >      >     What are the state of the connections in > pg_stat_activity abd > >      >     process explorer before and after reboot. The sockets > exists and > >      >     active,  or are residual in pg stats only. > >      > > >      > > > > > > > > > > -- > May the source be with you > -- May the source be with you