Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rmXyJ-008XaP-3o for pgsql-docs@arkaria.postgresql.org; Tue, 19 Mar 2024 11:49:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rmXyH-00DR7c-MJ for pgsql-docs@arkaria.postgresql.org; Tue, 19 Mar 2024 11:49:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rmXyF-00DQTZ-PS for pgsql-docs@lists.postgresql.org; Tue, 19 Mar 2024 11:49:33 +0000 Received: from fout2-smtp.messagingengine.com ([103.168.172.145]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rmXyC-005MAt-SV for pgsql-docs@lists.postgresql.org; Tue, 19 Mar 2024 11:49:31 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailfout.nyi.internal (Postfix) with ESMTP id 001961380102; Tue, 19 Mar 2024 07:49:26 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 19 Mar 2024 07:49:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:reply-to :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1710848966; x=1710935366; bh=C DRw6+Fjujtmrzfj6nxhprNCvHCAlG3t5WCxNkfDxbA=; b=jQxoLY1ZIGGVa2OqH 59IiM7SCDx9DDPuvxtl8lkpvbclKF5eo84SFE9FZ7U+2HDxA7fNGqFv0k670KDk5 y0QWxLL1WoSkb3xxw3gjMVUn8wQ+fE21QnL+wD7TbB2emu9pwJvOi0xzsArWsryC LYAlx4KpbwemLhgbRV5GD/n0K9MuqbA7/el0eIIyh6h1qoaxSQ5woIST0cP3xtSu Q7OmXVWzjBG7nhUegc7XnrUGrtS/G0CPtPetRRQF28rGA+6XRrTg5y7lJLc0CFgw pGHMjISk85stI8NnqRIzK8Z4V98oPzJfA+VzpzqBqgfoyImLEmQPRHWe2ntSi13y sg7jw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrledtgddtiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfggtggugfgjsehtkeertd dttdejnecuhfhrohhmpeetlhhvrghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvges rghlvhhhrdhnohdqihhprdhorhhgqeenucggtffrrghtthgvrhhnpeelfeekhffgleetie egjeekvdejvdelhfeuheefvdejheeuteevteejkeeufffgheenucffohhmrghinhepphho shhtghhrvghsqhhlrdhorhhgpdgvnhhtvghrphhrihhsvggusgdrtghomhenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvges rghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 19 Mar 2024 07:49:26 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1710848963; bh=RkKPhH2ETU587GycK3tIZ6WvkXHAvucnqH9SDncN0bk=; h=Date:From:To:Subject:In-Reply-To:From; b=nXwbHa0RJEu6B4rCC+n6LkAxiVXOFMft/Gjqtr19VJE9fJv37NRD+Ykj3EZ/UYjG3 I+fKL9so3JOzv7cdPVXgbevI37WlOCZ4ff8wkgNOSoU66qBKT6IeA5qUBPHaOrH0uz SA9D5R/OTkWP/yBQvSPWD2WqBsa8gTKktgRw0I/W9xIGYnuEmo+ZqmhCRQ4/YE1a3+ LbsRZs5scOnonQfnBMuGsxFwuoJPjz5O0EF04Xtl1y5YkpTmjAUEzj7lXV/XaQNRyX Z72ZMGnI2S9t+zASEBj2wtYlz7peCtN9jOhYBoXeFUPA+YMEhXh50gA1G4pwufz92i Q4sH5aqUm9hIw== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 9B62CCD2; Tue, 19 Mar 2024 12:49:23 +0100 (CET) Date: Tue, 19 Mar 2024 12:49:23 +0100 From: Alvaro Herrera To: jbe-mlist@magnetkern.de, pgsql-docs@lists.postgresql.org Subject: Re: Non-blocking synchronization in libpq using pipeline mode Message-ID: <202403191149.asubmjesltim@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <170976853548.643.17571475764668611072@wrigleys.postgresql.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2024-Mar-06, PG Doc comments form wrote: > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/16/libpq-pipeline-mode.html > Description: > > The calls to PQpipelineSync and PQsendFlushRequest may either report failure > or success, but not that data could not be written as of yet because the > request would block. Is this a literal quote? If so, where do you see it? > Does this mean that > > 1. these functions will always block when invoked and the socket is not > ready to accept the number of bytes that need to be written (assuming the > number of bytes required to be written is greater than one byte) No. > 2. the synchronization or flush request need to be flushed manually with > successive PQflush calls Yes. > or > > 3. the functions will return an error condition when the connection is > non-blocking and no data could be written. No. > Any clarification in the documentation would be appreciated. So I checked https://www.postgresql.org/docs/16/libpq-pipeline-mode.html and it has this, under PQsendFlushRequest: The server flushes its output buffer automatically as a result of PQpipelineSync being called, or on any request when not in pipeline mode; this function is useful to cause the server to flush its output buffer in pipeline mode without establishing a synchronization point. Note that the request is not itself flushed to the server automatically; use PQflush if necessary. which I think answers what you are asking. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "Just treat us the way you want to be treated + some extra allowance for ignorance." (Michael Brusser)