| From: | Fujii Masao <masao(dot)fujii(at)gmail(dot)com> |
|---|---|
| To: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Is abort() still needed in WalSndShutdown()? |
| Date: | 2026-01-23 12:13:58 |
| Message-ID: | CAHGQGwHPX1yoixq+YB5rF4zL90TMmSEa3FpHURtqW3Jc5+=oSA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi,
While reviewing the patch [1], I found that WalSndShutdown() calls abort()
with the comment "keep the compiler quiet" just after proc_exit(0).
static void
WalSndShutdown(void)
{
/*
* Reset whereToSendOutput to prevent ereport from attempting to send any
* more messages to the standby.
*/
if (whereToSendOutput == DestRemote)
whereToSendOutput = DestNone;
proc_exit(0);
abort(); /* keep the compiler quiet */
}
This may have been necessary in the past, but is it still required?
Other functions, such as CheckpointerMain(), simply call proc_exit(0)
without an abort(), which doesn't seem to cause compiler warnings.
That made me wonder whether the abort() in WalSndShutdown() is
still needed, or which compiler would actually warn if WalSndLoop()
does not end with an abort().
Thoughts?
[1] https://postgr.es/m/d062db6a-8040-41eb-b3c9-32c3af30ef2b@postgrespro.ru
--
Fujii Masao
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Soumya S Murali | 2026-01-23 12:17:38 | Re: Checkpointer write combining |
| Previous Message | Vitaly Davydov | 2026-01-23 11:51:49 | Re: Deadlock detector fails to activate on a hot standby replica |