Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1flgwt-0008QB-Qe for pgsql-general@arkaria.postgresql.org; Fri, 03 Aug 2018 20:45:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1flgwr-0003Fr-Ld for pgsql-general@arkaria.postgresql.org; Fri, 03 Aug 2018 20:45:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1flgwr-0003Fg-CO for pgsql-general@lists.postgresql.org; Fri, 03 Aug 2018 20:45:21 +0000 Received: from mta04.3.doruk.net.tr ([81.21.172.142] helo=mta04.doruk.net.tr) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1flgwo-0006iL-9I for pgsql-general@postgresql.org; Fri, 03 Aug 2018 20:45:20 +0000 Received: from cmail19.webkontrol.doruk.net.tr ([212.58.6.99]) by mta04.doruk.net.tr with esmtp (Exim 4.86) (envelope-from ) id 1flgwl-000BNv-KO for pgsql-general@postgresql.org; Fri, 03 Aug 2018 23:45:15 +0300 Received: from DESKTOPM80CG12 ([31.206.45.189]) by cmail19.webkontrol.doruk.net.tr (IceWarp 11.1.2.0) with ASMTP id 201808032345540348 for ; Fri, 03 Aug 2018 23:45:54 +0300 From: =?iso-8859-9?B?RXJ0YW4gS/zn/Gtv8Gx1?= To: References: <000201d4291d$436e75d0$ca4b6170$@1nar.com.tr> <13817.1533076425@sss.pgh.pa.us> In-Reply-To: <13817.1533076425@sss.pgh.pa.us> Subject: RE: How to prevent "no wait lock" after a connection drop Date: Fri, 3 Aug 2018 23:45:15 +0300 Message-ID: <00a901d42b6a$e203bad0$a60b3070$@1nar.com.tr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-9" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQH65lGlB8gQkrupx8cCcSPkaBQzRwIvzY5HpE+J6SA= Content-Language: tr List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > -----Original Message----- > From: Tom Lane =20 > Sent: Wednesday, August 1, 2018 1:34 AM > To: Ertan K=FC=E7=FCko=F0lu > Cc: pgsql-general@postgresql.org > Subject: Re: How to prevent "no wait lock" after a connection drop > > =3D?iso-8859-9?B?RXJ0YW4gS/zn/Gtv8Gx1?=3D = writes: > > What I observe during my tests is that if I intentionally drop=20 > > internet connection during any stage of data transfer (that is = mostly=20 > > while inserting to tables) application gives error and stop. For = next=20 > > sync operation (which runs every 5 mins) gets "no wait lock" error = and=20 > > exit without doing anything. That lock stage roughly stays for 1-2 = hours or more. > > This probably corresponds to the TCP timeout needed for the server's kernel to decide the connection is lost; until then, the > backend = session will just sit there waiting for more data, and it'll be holding whatever locks it had too. > > You could adjust the server's tcp_keepalives_xxx settings to make it notice the connection drop more quickly. > > regards, tom lane Hello, Server TCP timeout parameters set to identify a dropped connection in = 3.5 minutes max. I am waiting for test results. Thanks & regards, Ertan