Commit 2048e5b8 authored by Noah Misch's avatar Noah Misch

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.
parent 894459e5
...@@ -1216,7 +1216,7 @@ PostmasterMain(int argc, char *argv[]) ...@@ -1216,7 +1216,7 @@ PostmasterMain(int argc, char *argv[])
* normal case on Windows, which offers neither fork() nor sigprocmask(). * normal case on Windows, which offers neither fork() nor sigprocmask().
*/ */
if (pthread_is_threaded_np() != 0) if (pthread_is_threaded_np() != 0)
ereport(LOG, ereport(FATAL,
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
errmsg("postmaster became multithreaded during startup"), errmsg("postmaster became multithreaded during startup"),
errhint("Set the LC_ALL environment variable to a valid locale."))); errhint("Set the LC_ALL environment variable to a valid locale.")));
...@@ -4781,11 +4781,14 @@ ExitPostmaster(int status) ...@@ -4781,11 +4781,14 @@ ExitPostmaster(int status)
/* /*
* There is no known cause for a postmaster to become multithreaded after * There is no known cause for a postmaster to become multithreaded after
* startup. Recheck to account for the possibility of unknown causes. * startup. Recheck to account for the possibility of unknown causes.
* This message uses LOG level, because an unclean shutdown at this point
* would usually not look much different from a clean shutdown.
*/ */
if (pthread_is_threaded_np() != 0) if (pthread_is_threaded_np() != 0)
ereport(LOG, ereport(LOG,
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), (errcode(ERRCODE_INTERNAL_ERROR),
errmsg("postmaster became multithreaded"))); errmsg_internal("postmaster became multithreaded"),
errdetail("Please report this to <pgsql-bugs@postgresql.org>.")));
#endif #endif
/* should cleanup shared memory and kill all backends */ /* should cleanup shared memory and kill all backends */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment