Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit63a4b9f

Browse files
committed
Don't ask for bug reports about pthread_is_threaded_np() != 0.
We thought that this condition was unreachable in ExitPostmaster,but actually it's possible if you have both a misconfigured localesetting and some other mistake that causes PostmasterMain to bailout before reaching its own check of pthread_is_threaded_np().Given the lack of other reports, let's not ask for bug reports ifthis occurs; instead just give the same hint as in PostmasterMain.Bug: #18783Reported-by: anani191181515@gmail.comAuthor: Tom Lane <tgl@sss.pgh.pa.us>Reviewed-by: Noah Misch <noah@leadboat.com>Discussion:https://postgr.es/m/18783-d1873b95a59b9103@postgresql.orgDiscussion:https://postgr.es/m/206317.1737656533@sss.pgh.pa.usBackpatch-through: 13
1 parent3085993 commit63a4b9f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

‎src/backend/postmaster/postmaster.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,6 +1387,8 @@ PostmasterMain(int argc, char *argv[])
13871387
* calls fork() without an immediate exec(), both of which have undefined
13881388
* behavior in a multithreaded program. A multithreaded postmaster is the
13891389
* normal case on Windows, which offers neither fork() nor sigprocmask().
1390+
* Currently, macOS is the only platform having pthread_is_threaded_np(),
1391+
* so we need not worry whether this HINT is appropriate elsewhere.
13901392
*/
13911393
if (pthread_is_threaded_np()!=0)
13921394
ereport(FATAL,
@@ -5134,15 +5136,16 @@ ExitPostmaster(int status)
51345136

51355137
/*
51365138
* There is no known cause for a postmaster to become multithreaded after
5137-
* startup. Recheck to account for the possibility of unknown causes.
5139+
* startup. However, we might reach here via an error exit before
5140+
* reaching the test in PostmasterMain, so provide the same hint as there.
51385141
* This message uses LOG level, because an unclean shutdown at this point
51395142
* would usually not look much different from a clean shutdown.
51405143
*/
51415144
if (pthread_is_threaded_np()!=0)
51425145
ereport(LOG,
5143-
(errcode(ERRCODE_INTERNAL_ERROR),
5144-
errmsg_internal("postmaster became multithreaded"),
5145-
errdetail("Please report thisto<%s>.",PACKAGE_BUGREPORT)));
5146+
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
5147+
errmsg("postmaster became multithreaded"),
5148+
errhint("Set the LC_ALL environment variabletoa valid locale.")));
51465149
#endif
51475150

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp