pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: dafoer_x@163.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18331: Why is the session lock (DEFAULT_LOCKMETHOD) not automatically released during process exit?
Date: Mon, 05 Feb 2024 11:04:12 -0500
Message-ID: <123077.1707149052@sss.pgh.pa.us> (raw)
In-Reply-To: <18331-b44b290d8d84d690@postgresql.org>
References: <18331-b44b290d8d84d690@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> writes:
> The comment for the function LockRelationIdForSession mentions “It will be
> removed  when UnlockRelationIdForSession() is called, or if an
> ereport(ERROR) occurs,  or if the backend exits.”
> However, the callback function ShutdownPostgres, which is triggered during
> process exit, only cleans up locks of type USER_LOCKMETHOD. Is it possible
> to automatically clean up session locks of type DEFAULT_LOCKMETHOD?

I think you are looking in the wrong place.  Normal locks are released
in the transaction-ending code.  We need the special case in
ShutdownPostgres because that's not true for user locks.

			regards, tom lane





view thread (2+ messages)

Message-ID: <123077.1707149052@sss.pgh.pa.us>
Permalink:  ../123077.1707149052@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/123077.1707149052@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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dafoer_x@163.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #18331: Why is the session lock (DEFAULT_LOCKMETHOD) not automatically released during process exit?
  In-Reply-To: <123077.1707149052@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