Re: Code paths where LWLock should be released on failure - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Code paths where LWLock should be released on failure
Date
Msg-id 20150423074514.GD8239@alap3.anarazel.de
Whole thread Raw
In response to Code paths where LWLock should be released on failure  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
Hi,m

On 2015-04-23 13:51:57 +0900, Michael Paquier wrote:
> After looking at bug #13128, I have been looking at the code around
> LWLockAcquire/Release to see if there are similar issues elsewhere.
> Here are my findings:

Afaics all of these should actually be handled by the paths that release
locks upon error.

> 5) In ReplicationSlotCreate@slot.c, I would think that
> ReplicationSlotAllocationLock should be released when all the locks
> are in use. Similarly, in  ReplicationSlotDropAcquired,
> ReplicationSlotAllocationLock should be released when !fail_softly.
> SaveSlotToPath could also be made safer when a file could not be
> created.

When called via SQL these are released by normal error processing, in
walsender they're released by WalSndErrorCleanup().

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Freeze avoidance of very large table.
Next
From: Marko Tiikkaja
Date:
Subject: Re: PL/pgSQL, RAISE and error context