Re: Code paths where LWLock should be released on failure

From: Andres Freund <andres(at)anarazel(dot)de>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Code paths where LWLock should be released on failure
Date: 2015-04-23 07:45:14
Message-ID: 20150423074514.GD8239@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)slot(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Marko Tiikkaja 2015-04-23 07:53:58 Re: PL/pgSQL, RAISE and error context
Previous Message Heikki Linnakangas 2015-04-23 07:42:59 Re: Freeze avoidance of very large table.