pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ertan Küçükoðlu <ertan.kucukoglu@1nar.com.tr>
Cc: pgsql-general@postgresql.org
Subject: Re: How to prevent "no wait lock" after a connection drop
Date: Tue, 31 Jul 2018 18:33:45 -0400
Message-ID: <13817.1533076425@sss.pgh.pa.us> (raw)
In-Reply-To: <000201d4291d$436e75d0$ca4b6170$@1nar.com.tr>
References: <000201d4291d$436e75d0$ca4b6170$@1nar.com.tr>

=?iso-8859-9?B?RXJ0YW4gS/zn/Gtv8Gx1?= <ertan.kucukoglu@1nar.com.tr> writes:
> What I observe during my tests is that if I intentionally drop internet
> connection during any stage of data transfer (that is mostly while inserting
> to tables) application gives error and stop. For next sync operation (which
> runs every 5 mins) gets "no wait lock" error and 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




view thread (3+ messages)  latest in thread

Message-ID: <13817.1533076425@sss.pgh.pa.us>
Permalink:  ../13817.1533076425@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/13817.1533076425@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, ertan.kucukoglu@1nar.com.tr
  Subject: Re: How to prevent "no wait lock" after a connection drop
  In-Reply-To: <13817.1533076425@sss.pgh.pa.us>
  References: <000201d4291d$436e75d0$ca4b6170$@1nar.com.tr> <13817.1533076425@sss.pgh.pa.us>

* 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