agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix socket_putmessage_noblock() to call socket_putmessage()
Date: Thu, 23 Jul 2026 07:53:55 +0000
Message-ID: <E1wmoFf-00000000PRJ-2nXy@gemulon.postgresql.org> (raw)

Fix socket_putmessage_noblock() to call socket_putmessage()

socket_putmessage_noblock() used pq_putmessage(), which redirects to
PqCommMethods->putmessage.  In the common cases, this points to
socket_putmessage(), but it would become incorrect if PqCommMethods
points to a different implementation.

This change may look like a bug, but as far as I can see this is mostly
cosmetic.  The code is able to work currently, as the repalloc() done in
the noblock() call ensures that the blocking path of internal_putbytes()
is never reached.  The issue has gone unnoticed since 2bd9e412f92b.

Author: Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/CAO6_Xqpf5+Rzw_-XOOz-d-R5x6_2JHtpnzXP0nrYWiHyZokA_Q@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/544d25b7af958ca6c03e98bfbc1538c295b30601

Modified Files
--------------
src/backend/libpq/pqcomm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



Message-ID: <E1wmoFf-00000000PRJ-2nXy@gemulon.postgresql.org>
Permalink:  ../E1wmoFf-00000000PRJ-2nXy@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1wmoFf-00000000PRJ-2nXy@gemulon.postgresql.org

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix socket_putmessage_noblock() to call socket_putmessage()
  In-Reply-To: <E1wmoFf-00000000PRJ-2nXy@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox