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

Commit1a8aa64

Browse files
committed
Setup SIGUSR1 procsignal_sigusr1_handler handler.
This is normally automatically done when a bgworker declares theBGWORKER_BACKEND_DATABASE_CONNECTION flag, but our bgworker doesn't connect todatabases, even though it calls InitPostgres, which will still initialize a newbacckend and thus participate to the ProcSignal infrastructure.This wasn't a problem until recently, but now that DROP DATABASE relies onPROCSIG_BARRIER to work on Windows (see commit4eb2176318d0561846c1f9fb3c68bede799d640f) we need to respond to ProcSignalnotifications.
1 parent4761667 commit1a8aa64

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

‎collector.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,16 @@ collector_main(Datum main_arg)
339339
* any equivalent of the backend's command-read loop, where interrupts can
340340
* be processed immediately, so make sure ImmediateInterruptOK is turned
341341
* off.
342+
*
343+
* We also want to respond to the ProcSignal notifications. This is done
344+
* in the upstream provided procsignal_sigusr1_handler, which is
345+
* automatically used if a bgworker connects to a database. But since our
346+
* worker doesn't connect to any database even though it calls
347+
* InitPostgres, which will still initializze a new backend and thus
348+
* partitipate to the ProcSignal infrastructure.
342349
*/
343350
pqsignal(SIGTERM,handle_sigterm);
351+
pqsignal(SIGUSR1,procsignal_sigusr1_handler);
344352
BackgroundWorkerUnblockSignals();
345353

346354
#ifPG_VERSION_NUM >=110000
@@ -379,6 +387,9 @@ collector_main(Datum main_arg)
379387
boolwrite_history,
380388
write_profile;
381389

390+
/* We need an explicit call for at least ProcSignal notifications. */
391+
CHECK_FOR_INTERRUPTS();
392+
382393
/* Wait calculate time to next sample for history or profile */
383394
current_ts=GetCurrentTimestamp();
384395

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp