Re: [PATCH] fix race condition in libpq (related to ssl connections)
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Aleksander Alekseev <aleksander@timescale.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Willi Mann <w.mann@celonis.de>
Date: 2023-11-27T03:03:45Z
Lists: pgsql-hackers
On Fri, Nov 24, 2023 at 04:48:58PM +0900, Michael Paquier wrote: > I've looked at this idea, and finished by being unhappy with the error > handling that we are currently assuming in my_SSL_set_fd() in the > event of an error in the bio method setup, which would be most likely > an OOM, so let's use ssl_config_mutex in my_BIO_s_socket(). Another > thing is that I have minimized the manipulation of my_bio_methods in > the setup routine. I've spent more time on that today, and the patch I've posted on Friday had a small mistake in the non-HAVE_BIO_METH_NEW path when saving the BIO_METHODs causing the SSL tests to fail with older OpenSSL versions. I've fixed that and the patch was straight-forward, so applied it down to v12. I didn't use Willi's patch at the end, still credited him as author as his original patch is rather close to the result committed and it feels that he has spent a good deal of time on this issue. -- Michael
Commits
-
Fix race condition with BIO methods initialization in libpq with threads
- 0217a7444a57 12.18 landed
- 09f680d114b5 13.14 landed
- c3b79223f355 14.11 landed
- b97226815030 15.6 landed
- 8984480b545d 16.2 landed
- 01eca6a913c4 17.0 landed
-
Doc: Adjust libpq docs about thread safety.
- ce0b0fa3e792 17.0 cited