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

Commitbed5eac

Browse files
committed
Unset MyBEEntry, making elog.c's call to pgstat_get_my_query_id() safe.
Previously log messages late during shutdown could end up using either anotherbackend's PgBackendStatus (multi user) or segfault (single user) becausepgstat_get_my_query_id()'s check for !MyBEEntry didn't filter out use afterpgstat_beshutdown_hook().This became a bug in4f0b096, but was a bit fishy before. But giventhere's no known problematic cases before 14, it doesn't seem worthbackpatching further.Also fixes a wrong filename in a comment, introduced ine102504.Reported-By: Andres Freund <andres@anarazel.de>Reviewed-By: Julien Rouhaud <rjuju123@gmail.com>Discussion:https://postgr.es/m/Julien Rouhaud <rjuju123@gmail.com>Backpatch: 14-
1 parent4cd7a18 commitbed5eac

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎src/backend/utils/activity/backend_status.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ boolpgstat_track_activities = false;
4646
intpgstat_track_activity_query_size=1024;
4747

4848

49-
/* exposed so thatprogress.c can access it */
49+
/* exposed so thatbackend_progress.c can access it */
5050
PgBackendStatus*MyBEEntry=NULL;
5151

5252

@@ -469,6 +469,9 @@ pgstat_beshutdown_hook(int code, Datum arg)
469469
beentry->st_procpid=0;/* mark invalid */
470470

471471
PGSTAT_END_WRITE_ACTIVITY(beentry);
472+
473+
/* so that functions can check if backend_status.c is up via MyBEEntry */
474+
MyBEEntry=NULL;
472475
}
473476

474477
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp