Thread: Shouldn't GSSAPI and SSL code use FeBeWaitSet?
Hi, While working on a patch to reuse a common WaitEventSet for latch waits, I noticed that be-secure-gssapi.c and be-secure-openssl.c don't use FeBeWaitSet. They probably should, for consistency with be-secure.c, because that surely holds the socket they want, no? The attached patch passes the "ssl" and "kerberos" tests and reaches that code, confirmed by adding some log messages. I'm not actually sure what the rationale is for reporting "terminating connection due to unexpected postmaster exit" here but not elsewhere. I copied the error from be-secure.c.
Attachment
On Mon, Feb 24, 2020 at 4:49 PM Thomas Munro <thomas.munro@gmail.com> wrote: > While working on a patch to reuse a common WaitEventSet for latch > waits, I noticed that be-secure-gssapi.c and be-secure-openssl.c don't > use FeBeWaitSet. They probably should, for consistency with > be-secure.c, because that surely holds the socket they want, no? Hmm. Perhaps it's like that because they're ignoring their latch (though they pass it in just because that interface requires it). So then why not reset it and process read interrupts, like be-secure.c?
On Mon, Feb 24, 2020 at 4:55 PM Thomas Munro <thomas.munro@gmail.com> wrote: > On Mon, Feb 24, 2020 at 4:49 PM Thomas Munro <thomas.munro@gmail.com> wrote: > > While working on a patch to reuse a common WaitEventSet for latch > > waits, I noticed that be-secure-gssapi.c and be-secure-openssl.c don't > > use FeBeWaitSet. They probably should, for consistency with > > be-secure.c, because that surely holds the socket they want, no? > > Hmm. Perhaps it's like that because they're ignoring their latch > (though they pass it in just because that interface requires it). So > then why not reset it and process read interrupts, like be-secure.c? Perhaps the theory is that it doesn't matter if they ignore eg SIGQUIT, because authentication_timeout will come along in (say) 60 seconds and exit anyway? That makes me wonder whether it's OK that StartupPacketTimeoutHandler() does proc_exit() from a signal handler.