Re: BUG #17391: While using --with-ssl=openssl and PG_TEST_EXTRA='ssl' options, SSL tests fail on OpenBSD 7.0
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
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:10:25Z
Lists: pgsql-bugs
Hi, On 2022-02-10 19:44:57 -0500, Tom Lane wrote: > BTW, this also changes what is looking to me like a thinko in > my_sock_write(): if we get a zero result from pqsecure_raw_write(), > we should not be consulting errno, because it wouldn't have > been set. Am I missing something there? It does look like an oversight. I think it's effectively harmless, because pqsecure_raw_write() will always set up result_errno = 0, and it doesn't make the same mistake of checking errno with a 0 result. > + * If a socket-level write failure occurs, conn->write_failed is set and the > + * error message is saved in conn->write_err_msg, but we clear the output > + * buffer and return zero anyway; this is because callers should soldier on > + * until it's possible to read from the server and check for an error message. > + * write_err_msg should be reported only when we are unable to obtain a server > + * error first. Much of that behavior is implemented at lower levels, but > + * this function deals with some edge cases. The "soldier on until" bit seems to imply something stronger than how I understand this to work. Makes it sound like we're going to busy loop or such if necessary. Maybe something like "should soldier on until they have tried to read from the server, so that server error messages can be processed"? 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()? Greetings, Andres Freund
Commits
-
Move libpq's write_failed mechanism down to pqsecure_raw_write().
- faa189c932d5 15.0 landed
-
Fix thinko in PQisBusy().
- c9d35dc7f8a9 12.11 landed
- ae27b1acc43d 14.3 landed
- 51ee561f5671 13.7 landed
- 335fa5a26029 15.0 landed
-
Set SNI ClientHello extension to localhost in tests
- 6d503d2a4732 15.0 landed
- 5f00ef065ec8 14.3 landed
-
Improve worst-case performance of text_position_get_match_pos()
- b31e3f561365 15.0 cited