Re: BUG #17391: While using --with-ssl=openssl and PG_TEST_EXTRA='ssl' options, SSL tests fail on OpenBSD 7.0

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Daniel Gustafsson <daniel@yesql.se>, Thomas Munro <thomas.munro@gmail.com>, byavuz81@gmail.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>, Heikki Linnakangas <heikki.linnakangas@iki.fi>, Michael Paquier <michael@paquier.xyz>
Date: 2022-02-11T01:25:28Z
Lists: pgsql-bugs
Andres Freund <andres@anarazel.de> writes:
> It's not in this change, but related. I don't really understand the

> 	/*
> 	 * PQgetResult will return immediately in all states except BUSY, or if we
> 	 * had a write failure.
> 	 */
> 	return conn->asyncStatus == PGASYNC_BUSY || conn->write_failed;

> business in PQisBusy(). Won't that potentially lead to clients waiting for
> more network IO indefinitely, never getting around to calling PQgetResult()?

I was staring at that for awhile too.  It's my own code (from 1f39a1c0641)
but it sure confuses me now; at the very least the code is not in sync
with the comment.  However, it's been that way for a couple years now and
we've not had complaints suggesting it's broken, so maybe it's the comment
that's wrong.

			regards, tom lane



Commits

  1. Move libpq's write_failed mechanism down to pqsecure_raw_write().

  2. Fix thinko in PQisBusy().

  3. Set SNI ClientHello extension to localhost in tests

  4. Improve worst-case performance of text_position_get_match_pos()