Re: backtrace_on_internal_error
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Peter Eisentraut <peter@eisentraut.org>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2023-12-09T23:14:00Z
Lists: pgsql-hackers
Attachments
- v3-0001-handle-openssl-returning-errno-zero.patch (text/x-diff) patch v3-0001
- v3-0002-handle-zero-errno-generally.patch (text/x-diff) patch v3-0002
Andres Freund <andres@anarazel.de> writes: > On 2023-12-09 12:41:30 -0500, Tom Lane wrote: >> On further reflection I realized that you're right so far as the SSL >> code path goes, because SSL_write() can involve physical reads as well >> as writes, so at least in principle it's possible that we'd see EOF >> reported this way from that function. > Heh. I'll just claim that's what I was thinking about. > I'd perhaps add a comment explaining why it's plausible that we'd see that > that in the write case. Done in v3 attached. >> I also realized that we have more or less the same problem at the >> caller level, allowing a similar failure for non-SSL connections. > If we were treating it as EOF, we'd not "queue" an error message, no? Normally > recv() returns 0 in that case, so we'd just return, right? Duh, right, so more like this version. I'm not actually sure that the fe-secure.c part of v3-0002 is necessary, because it's guarding plain recv(2) which really shouldn't return -1 without setting errno. Still, it's a pretty harmless addition. regards, tom lane
Commits
-
Add GUC backtrace_on_internal_error
- a740b213d4b4 17.0 landed
-
Fix variable name and comment
- 541e8f14a185 17.0 landed
-
Be more wary about OpenSSL not setting errno on error.
- ebbd499d4b55 16.2 landed
- 87b46ad90491 13.14 landed
- 551d4b28e445 15.6 landed
- 271d24f31ddd 12.18 landed
- 0a5c46a7a488 17.0 landed
- 07ce2432682d 14.11 landed