Skip to content

Commit 2048e5b

Browse files
committed
On Darwin, refuse postmaster startup when multithreaded.
The previous commit introduced its report at LOG level to avoid surprises at minor release upgrade time. Compel users deploying the next major release to also deploy the reported workaround.
1 parent 894459e commit 2048e5b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/backend/postmaster/postmaster.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,7 @@ PostmasterMain(int argc, char *argv[])
12161216
* normal case on Windows, which offers neither fork() nor sigprocmask().
12171217
*/
12181218
if (pthread_is_threaded_np() != 0)
1219-
ereport(LOG,
1219+
ereport(FATAL,
12201220
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
12211221
errmsg("postmaster became multithreaded during startup"),
12221222
errhint("Set the LC_ALL environment variable to a valid locale.")));
@@ -4781,11 +4781,14 @@ ExitPostmaster(int status)
47814781
/*
47824782
* There is no known cause for a postmaster to become multithreaded after
47834783
* startup. Recheck to account for the possibility of unknown causes.
4784+
* This message uses LOG level, because an unclean shutdown at this point
4785+
* would usually not look much different from a clean shutdown.
47844786
*/
47854787
if (pthread_is_threaded_np() != 0)
47864788
ereport(LOG,
4787-
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
4788-
errmsg("postmaster became multithreaded")));
4789+
(errcode(ERRCODE_INTERNAL_ERROR),
4790+
errmsg_internal("postmaster became multithreaded"),
4791+
errdetail("Please report this to <pgsql-bugs@postgresql.org>.")));
47894792
#endif
47904793

47914794
/* should cleanup shared memory and kill all backends */

0 commit comments

Comments
 (0)