Re: BUG #18331: Why is the session lock (DEFAULT_LOCKMETHOD) not automatically released during process exit?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: dafoer_x(at)163(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18331: Why is the session lock (DEFAULT_LOCKMETHOD) not automatically released during process exit?
Date: 2024-02-05 16:04:12
Message-ID: 123077.1707149052@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Marcelo Marques 2024-02-05 16:27:40 Re: BUG #18328: yum update nothing provides libarmadillo.so.12()(64bit) needed by gdal36-libs-3.6.4-6PGDG.rhel9.x86
Previous Message Tom Lane 2024-02-05 15:24:51 Re: BUG #18312: libpq: PQsetdbLogin() not thread-safe