Re: Patch proposal: New hooks in the connection path
От | Drouvot, Bertrand |
---|---|
Тема | Re: Patch proposal: New hooks in the connection path |
Дата | |
Msg-id | 51b3c711-d8bb-babd-dbd6-bcdad1633bb8@amazon.com обсуждение исходный текст |
Ответ на | Re: Patch proposal: New hooks in the connection path ("Drouvot, Bertrand" <bdrouvot@amazon.com>) |
Ответы |
Re: Patch proposal: New hooks in the connection path
Re: Patch proposal: New hooks in the connection path |
Список | pgsql-hackers |
Hi, On 7/12/22 2:58 PM, Drouvot, Bertrand wrote: > Hi, > > On 7/11/22 8:18 AM, Drouvot, Bertrand wrote: >> Hi, >> >> The use case would be to increment a counter in shared memory (or >> most probably within an hash table) to reflect the number of times a >> startup packet timeout occurred. >> >> Reading the comments in/related to BackendInitialize() I understand >> that's definitely not safe to write in shared memory for the >> EXEC_BACKEND case, but wouldn't it be safe for the non EXEC_BACKEND >> case? >> >> BTW, it makes me realize that the hook being fired in the bad startup >> packet case: >> >> /* >> * Stop here if it was bad or a cancel packet. >> ProcessStartupPacket >> * already did any appropriate error reporting. >> */ >> if (status != STATUS_OK) >> + { >> + if (FailedConnection_hook) >> + (*FailedConnection_hook) >> (FCET_BAD_STARTUP_PACKET, port); >> proc_exit(0); >> + } >> >> is not safe for the EXEC_BACKEND case. >> > What about the idea to trigger the hook for the STARTUP PACKET TIMEOUT > and BAD STARTUP PACKET only for the non EXEC_BACKEND/Windows cases? > > I'm tempted to think it's better to have some cases where one could > benefit from the hook as opposed to none. > > Thoughts? Please find attached v2-0004-connection_hooks.patch as an attempt of doing so. Thanks -- Bertrand Drouvot Amazon Web Services: https://aws.amazon.com
Вложения
В списке pgsql-hackers по дате отправления: