diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2022-02-12 14:00:09 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2022-02-12 14:00:09 -0500 |
commit | faa189c932d51945b2285e277128b0f26b96afdd (patch) | |
tree | e738bfb913dbf58b165d29a76e8385c8b7e7850f /src/backend/jit/llvm/llvmjit_inline.cpp | |
parent | 335fa5a26029d8040ebf332fda3f900cc9da23f2 (diff) | |
download | postgresql-faa189c932d51945b2285e277128b0f26b96afdd.tar.gz postgresql-faa189c932d51945b2285e277128b0f26b96afdd.zip |
Move libpq's write_failed mechanism down to pqsecure_raw_write().
Commit 1f39a1c06 implemented write-failure postponement in pqSendSome,
which is above SSL/GSS processing. However, we've now seen failures
indicating that (some versions of?) OpenSSL have a tendency to report
write failures prematurely too. Hence, move the primary responsibility
for postponing write failures down to pqsecure_raw_write(), below
SSL/GSS processing. pqSendSome now sets write_failed only in corner
cases where we'd lost the connection already.
A side-effect of this change is that errors detected in the SSL/GSS
layer itself will be reported immediately (as if they were read
errors) rather than being postponed like write errors. That's
reverting an effect of 1f39a1c06, and I think it's fine: if there's
not a socket-level error, it's hard to be sure whether an OpenSSL
error ought to be considered a read or write failure anyway.
Another important point is that write-failure postponement is now
effective during connection setup. OpenSSL's misbehavior of this
sort occurs during SSL_connect(), so that's a change we want.
Per bug #17391 from Nazir Bilal Yavuz. Possibly this should be
back-patched, but I think it prudent to let it age awhile in HEAD
first.
Discussion: https://postgr.es/m/17391-304f81bcf724b58b@postgresql.org
Diffstat (limited to 'src/backend/jit/llvm/llvmjit_inline.cpp')
0 files changed, 0 insertions, 0 deletions