@@ -330,15 +330,8 @@ pgws_collector_main(Datum main_arg)
330330 /*
331331 * Establish signal handlers.
332332 *
333- * We want CHECK_FOR_INTERRUPTS() to kill off this worker process just as
334- * it would a normal user backend. To make that happen, we establish a
335- * signal handler that is a stripped-down version of die(). We don't have
336- * any equivalent of the backend's command-read loop, where interrupts can
337- * be processed immediately, so make sure ImmediateInterruptOK is turned
338- * off.
339- *
340- * We also want to respond to the ProcSignal notifications. This is done
341- * in the upstream provided procsignal_sigusr1_handler, which is
333+ * We want to respond to the ProcSignal notifications. This is done in
334+ * the upstream provided procsignal_sigusr1_handler, which is
342335 * automatically used if a bgworker connects to a database. But since our
343336 * worker doesn't connect to any database even though it calls
344337 * InitPostgres, which will still initializze a new backend and thus
@@ -489,12 +482,6 @@ pgws_collector_main(Datum main_arg)
489482
490483 MemoryContextReset (collector_context );
491484
492- /*
493- * We're done. Explicitly detach the shared memory segment so that we
494- * don't get a resource leak warning at commit time. This will fire any
495- * on_dsm_detach callbacks we've registered, as well. Once that's done,
496- * we can go ahead and exit.
497- */
498485 ereport (LOG , (errmsg ("pg_wait_sampling collector shutting down" )));
499486 proc_exit (0 );
500487}
0 commit comments