model-writtenrun 3821 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Willi Mann reported that unsynchronized BIO method initialization could fail SSL connections and even close the client's standard input; he supplied a reproducer and a patch using a dedicated mutex, while asking whether its initialization would work on Windows #1.
- Aleksander Alekseev reviewed the initial code favorably, suggested locking comments, and questioned the need for an automated test; he also raised a separate question about deprecating PQisthreadsafe() #2.
- Michael Paquier questioned adding another mutex and proposed moving BIO initialization under the existing ssl_config_mutex in pgtls_init() #3; Thomas Munro pointed to existing thread-safety documentation changes #5, while Michael maintained that explicitly deprecating PQisthreadsafe() was a separate topic #6.
- Michael traced the regression to removal of earlier locking, reproduced the failure with concurrent threads, and supplied a replacement that reused ssl_config_mutex directly in my_BIO_s_socket(), avoiding error-handling concerns with moving initialization and minimizing writes to the shared pointer #7.
- Michael committed the replacement as 01eca6a913 after correcting its older-OpenSSL copy operation, returning the local result, and adding a mutex-protection comment; his final message reported that older-OpenSSL SSL tests had exposed the copy mistake, confirmed backpatching through PostgreSQL 12, and retained Willi's author credit for the original work #8.