Should PostgresMain() do a LWLockReleaseAll()?

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Should PostgresMain() do a LWLockReleaseAll()?
Date: 2014-02-23 16:39:10
Message-ID: 20140223163910.GF28858@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Currently the error handling of normal backends only does a
LWLockReleaseAll() once CurrentTransactionState->state != TRANS_DEFAULT
because it's called in AbortTransaction(). There's pretty damn few
places that fiddle with lwlocks outside of a transaction command, but I
still do wonder whether it'd wouldn't be a tad more robust to
unconditionally do a LWLockReleaseAll(), just like other error handlers
are doing?
In comparison to the cost of a longjmp and the rest of error handling
that ought to be nearly free.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2014-02-23 19:04:39 often PREPARE can generate high load (and sometimes minutes long unavailability)
Previous Message Kohei KaiGai 2014-02-23 13:24:14 Re: Custom Scan APIs (Re: Custom Plan node)