[COMMITTERS] pgsql: Fix coding rules violations in walreceiver.c - Mailing list pgsql-committers

From Alvaro Herrera
Subject [COMMITTERS] pgsql: Fix coding rules violations in walreceiver.c
Date
Msg-id E1dzNk9-0005sE-8q@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix coding rules violations in walreceiver.c

1. Since commit b1a9bad9e744 we had pstrdup() inside a
spinlock-protected critical section; reported by Andreas Seltenreich.
Turn those into strlcpy() to stack-allocated variables instead.
Backpatch to 9.6.

2. Since commit 9ed551e0a4fd we had a pfree() uselessly inside a
spinlock-protected critical section.  Tom Lane noticed in code review.
Move down.  Backpatch to 9.6.

3. Since commit 64233902d22b we had GetCurrentTimestamp() (a kernel
call) inside a spinlock-protected critical section.  Tom Lane noticed in
code review.  Move it up.  Backpatch to 9.2.

4. Since commit 1bb2558046cc we did elog(PANIC) while holding spinlock.
Tom Lane noticed in code review.  Release spinlock before dying.
Backpatch to 9.2.

Discussion: https://postgr.es/m/87h8vhtgj2.fsf@ansel.ydns.eu

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/ad40d5f74585d1f14ea4b73c20fb5b2dabfb153f

Modified Files
--------------
src/backend/replication/walreceiver.c | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)


--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: [COMMITTERS] pgsql: Stamp 10.0.
Next
From: Tom Lane
Date:
Subject: [COMMITTERS] pgsql: Fix race condition with unprotected use of a latch pointervaria