From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: andy.ye@gtssz.net
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16194: use postgresql's pg_advisory_xact_lock error
Date: Tue, 7 Jan 2020 10:49:37 +0100
Message-ID: <20200107094937.acy423phs2r67bxo@development> (raw)
In-Reply-To: <16194-8f7bff6e93dbe84c@postgresql.org>
References: <16194-8f7bff6e93dbe84c@postgresql.org>
On Tue, Jan 07, 2020 at 09:33:26AM +0000, PG Bug reporting form wrote:
>The following bug has been logged on the website:
>
>Bug reference: 16194
>Logged by: andy ye
>Email address: andy.ye@gtssz.net
>PostgreSQL version: 9.5.11
>Operating system: ubuntu 16.04
>Description:
>
>When I use postgresql's pg_advisory_xact_lock for transaction security,
>especially RPC services, I often see that the lock is not released, causing
>the service to block for a long time. The blocking time is about 15 minutes.
>
That's rather suspicious. My guess would be that you're not actually
terminating the transaction, it's staying open and so the advisory lock
is not being released. And then ~15 minutes later some sort of timeout
is being hit, closing the connection (e.g. in a connection pool, app
server or something like that) and releasing the lock.
We need to see some sort of debugging info, demonstrating that the
transaction was actually finished (committed/released) and the lock is
still being held. So if you observe this, you need to get the relevant
info from pg_locks and pg_stat_activity.
A reproducer would be very useful, of course.
regards
--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
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-bugs@postgresql.org
Cc: tomas.vondra@2ndquadrant.com, andy.ye@gtssz.net
Subject: Re: BUG #16194: use postgresql's pg_advisory_xact_lock error
In-Reply-To: <20200107094937.acy423phs2r67bxo@development>
References: <16194-8f7bff6e93dbe84c@postgresql.org> <20200107094937.acy423phs2r67bxo@development>
* 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