Should PostgresMain() do a LWLockReleaseAll()? - Mailing list pgsql-hackers

From Andres Freund
Subject Should PostgresMain() do a LWLockReleaseAll()?
Date
Msg-id 20140223163910.GF28858@alap3.anarazel.de
Whole thread Raw
Responses Re: Should PostgresMain() do a LWLockReleaseAll()?  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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



pgsql-hackers by date:

Previous
From: Kohei KaiGai
Date:
Subject: Re: Custom Scan APIs (Re: Custom Plan node)
Next
From: Pavel Stehule
Date:
Subject: often PREPARE can generate high load (and sometimes minutes long unavailability)