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 1r79iW-004IHN-Fd for pgsql-bugs@arkaria.postgresql.org; Sun, 26 Nov 2023 07:38:12 +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 1r79hU-007IZ4-G3 for pgsql-bugs@arkaria.postgresql.org; Sun, 26 Nov 2023 07:37:08 +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 1r79hT-007IYw-SN for pgsql-bugs@lists.postgresql.org; Sun, 26 Nov 2023 07:37:08 +0000 Received: from tamriel.snowman.net ([70.109.60.50]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r79hP-008aPz-Vz for pgsql-bugs@lists.postgresql.org; Sun, 26 Nov 2023 07:37:06 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id AA9AB5F7B7; Sun, 26 Nov 2023 02:36:57 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=snowman.net; s=dkim; t=1700984217; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=caiXT7J4RjynOmVP4ewl3sT1ig205Ap+p6TKYlAZpcw=; b=KvoaMxMngvJeHfjW48FgeEJjc4MdIZkzo2af5cy84yWcbsodyOZJBWXmP754IJDYoSP5wN /nzNRpex3SqeY4N3ih1INQEVkItfJTNxJRbKkGnugMwxflig6klMb3gYIX+WSHvKZ14PBr PMcYFFEvF3ipT5ouz8VXgarMzxB05Vc= Date: Sun, 26 Nov 2023 02:36:57 -0500 From: Stephen Frost To: Tom Lane Cc: lars@greiz-reinsdorf.de, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18210: libpq: PQputCopyData sometimes fails in non-blocking mode over GSSAPI encrypted connection Message-ID: References: <18210-4c6d0b14627f2eb8@postgresql.org> <1675678.1700665886@sss.pgh.pa.us> <2199742.1700680746@sss.pgh.pa.us> <2524668.1700692174@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="NmelZd4C1SNAbMXe" Content-Disposition: inline In-Reply-To: <2524668.1700692174@sss.pgh.pa.us> User-Agent: Mutt/2.1.4 (2021-12-11) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --NmelZd4C1SNAbMXe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Tom Lane (tgl@sss.pgh.pa.us) wrote: > I wrote: > > I wonder if we should drop the idea of returning a positive bytecount > > after a partial write, and just return the pqsecure_raw_write result, > > and not reset PqGSSSendConsumed until we write everything presented. > > In edge cases maybe that would result in some buffer bloat, but it > > doesn't seem worse than what happens when the very first > > pqsecure_raw_write returns EINTR. >=20 > Here's a patch that fixes it along those lines. I like this better, > I think, not least because it removes the assumption that "interesting" > pqsecure_raw_write failures will recur on the next try. Thanks for looking into this. I agree with this approach and took a look through the patch and it all makes sense to me. > Still need to look at syncing the backend with this. I see you made similar changes to the backend and those also look good. Thanks again, Stephen --NmelZd4C1SNAbMXe Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEwf6gbxKhD863zrx/7WyKOINHZFUFAmVi9ZYACgkQ7WyKOINH ZFVqWA//TCuWdI22xUmJP9dgzWAhCFrIMZ9vCe+efIZB1gcx+XYm/GA0F2N1UWeX mLnAiz2l+PjbwJDIMGvZ5H+Ag+tir5FhyA8x2NROwDOatBTAdmy9TVMmgMNtVeUl e/0Ld8V1Ib7GgLWN7oBn4WxUyCZtXRqz/vUVbxY8v4NX4kQj2Bb6j7Y0A6DMVZ/h gD0vlW0Jy+j13xmxmND7IpCuWQxKAOwqcrautS6m2yThfN5st+0FXwk3OaxDIK4j OSkcGTnbXwgDswXfjjJ2ObEwbuNeyP9IUDYgJbm1i/5D3N9DsrkIzJUio+OysgDw xNdlCX7d1aiSrYdiz58pFOdEL1CwKa3elhvGJ3fjObh1FDS/XNwd+yd3yAiG1gHI qh56BpRXZULk4u0eW7TR4NBtFuqbj+UXo/cSKlm7Ygz6KwLxPDIgZkpXlJuOQKYm 2M/KfyLhqhM4rmei+FMTQyF73pMcJB9Po+7YP3eRTMZQPh7Urt0MYU2gN39ComfL o5Xqa9oaNcOQfYTwkCqoL3Z/jKTp3BSSFi6qroyirusJ9KpCS8qhHBxbfb+LCHRq oasVel+cgPKe8XsXwKFcNYsMIx3kXpmB/mLeVcwOJZfh+DO81Nr/TzNhP8/mu7S4 vkGgW1z+Qrl9kYy3p5hmbBwxw6Aw7vd2zAhB2esoAy1MlU/sZ98= =Aj49 -----END PGP SIGNATURE----- --NmelZd4C1SNAbMXe--