Re: BUG #17591: elog(ERROR) cause SharedSnapshotLock deadlock - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #17591: elog(ERROR) cause SharedSnapshotLock deadlock
Date
Msg-id 257677.1661174018@sss.pgh.pa.us
Whole thread Raw
In response to BUG #17591: elog(ERROR) cause SharedSnapshotLock deadlock  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> in lock.c, we can see code  Release lock before return    , e.g.
> ...
> bug we can see some code doesn't release the lock. Does it may cause
> deadlock?

Transaction cleanup will automatically release all locks (and other
resources too).  So the places that do a manual release before
elog(ERROR) are something of a waste of code space.  It might be worth
doing that if you're concerned about holding the lock for the minimum
possible amount of time; but usually that's only a consideration for
very heavily-contended spinlocks or LWLocks.

            regards, tom lane



pgsql-bugs by date:

Previous
From: John Naylor
Date:
Subject: Re: fetching bytea (blob) data of 850 MB from psql client failed
Next
From: "Garbuz, Yakov [ASM Research]"
Date:
Subject: Re: [External] Re: BUG #17585: Wrong path to the extension control file