Re: libpq OpenSSL and multithreading - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: libpq OpenSSL and multithreading
Date
Msg-id f84c9752-46b8-42bb-9974-50a398035577@eisentraut.org
Whole thread Raw
In response to Re: libpq OpenSSL and multithreading  (Daniel Gustafsson <daniel@yesql.se>)
List pgsql-hackers
On 22.10.25 10:59, Daniel Gustafsson wrote:
>> On 1 Sep 2025, at 07:27, Peter Eisentraut <peter@eisentraut.org> wrote:
> 
>> I suggest that instead of adding the context to the Port structure, make a separate context struct for this purpose,
forexample:
 
> 
> Fair enough, done in the attached.

This looks good to me.  (I would not have the CallbackErr typedef, since 
that additional abstraction doesn't buy anything.  But it's a small 
difference.)

>> This seems like an extremely inconvenient solution, as can be seen by the amount of changes your patch introduces.
Wecould just make errbuf thread-local and be done, without having to change the API.  (This is how glibc's strerror()
worksinternally.)
 
> 
> I assume you mean simply leaving it be for now awaiting more thread primitives
> to be added to fully support thread local storage?

Yes

> (sidenote; if our thread
> local store code will use TLS then be-secure-openssl.c will be challenging to
> read =)).

Yes, let's rename it to SSL to avoid this. ;-)




pgsql-hackers by date:

Previous
From: Richard Guo
Date:
Subject: Re: apply_scanjoin_target_to_paths and partitionwise join
Next
From: Peter Eisentraut
Date:
Subject: Re: Bump soft open file limit (RLIMIT_NOFILE) to hard limit on startup