Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rTAJ2-000tV4-Rd for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Jan 2024 00:42:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rTAJ2-006Rjc-05 for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Jan 2024 00:42:52 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rTAJ1-006RUA-M6 for pgsql-hackers@lists.postgresql.org; Fri, 26 Jan 2024 00:42:51 +0000 Received: from ml.sraoss.co.jp ([66.11.59.17]) by makus.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rTAIy-003O2G-EQ for pgsql-hackers@postgresql.org; Fri, 26 Jan 2024 00:42:50 +0000 Received: from sranhm.sraoss.co.jp (unknown [192.168.174.164]) by osspc26.sraoss.co.jp (Postfix) with ESMTP id 466D22F00093 for ; Fri, 26 Jan 2024 09:42:46 +0900 (JST) Received: from yugon-CFSV7-1 (unknown [192.168.176.17]) by sranhm.sraoss.co.jp (Postfix) with SMTP id 2EF79341768 for ; Fri, 26 Jan 2024 09:42:46 +0900 (JST) Date: Fri, 26 Jan 2024 09:42:45 +0900 From: Yugo NAGATA To: pgsql-hackers@postgresql.org Subject: Rename setup_cancel_handler in pg_dump Message-Id: <20240126094245.cf6718cc659273765f3ab69a@sraoss.co.jp> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Fri__26_Jan_2024_09_42_45_+0900_0Jj14cgvrqk51+Fd" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --Multipart=_Fri__26_Jan_2024_09_42_45_+0900_0Jj14cgvrqk51+Fd Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hi, Attached is a simple patch to rename setup_cancel_handler() in pg_dump/parallel.c. I am proposing it because there is a public function with the same name in fe_utils/cancel.c. I know pg_dump/parallel.c does not include fe_utils/cancel.h, so there is no conflict, but I think it is better to use different names to reduce possible confusion. I guess there was no concerns when setup_cancel_handler in pg_dump/parallel.c was introduced because the same name function was not in fe_utils that could be used in common between client tools.. The public setup_cancel_handler in fe_utils was introduced in a4fd3aa719e, where this function was moved from psql. Regards, Yugo Nagata -- Yugo NAGATA --Multipart=_Fri__26_Jan_2024_09_42_45_+0900_0Jj14cgvrqk51+Fd Content-Type: text/x-diff; name="pg_dump_setup_cancel_handler.patch" Content-Disposition: attachment; filename="pg_dump_setup_cancel_handler.patch" Content-Transfer-Encoding: 7bit diff --git a/src/bin/pg_dump/parallel.c b/src/bin/pg_dump/parallel.c index 188186829c..261b23cb3f 100644 --- a/src/bin/pg_dump/parallel.c +++ b/src/bin/pg_dump/parallel.c @@ -204,7 +204,7 @@ static ParallelSlot *GetMyPSlot(ParallelState *pstate); static void archive_close_connection(int code, void *arg); static void ShutdownWorkersHard(ParallelState *pstate); static void WaitForTerminatingWorkers(ParallelState *pstate); -static void setup_cancel_handler(void); +static void pg_dump_setup_cancel_handler(void); static void set_cancel_pstate(ParallelState *pstate); static void set_cancel_slot_archive(ParallelSlot *slot, ArchiveHandle *AH); static void RunWorker(ArchiveHandle *AH, ParallelSlot *slot); @@ -550,7 +550,7 @@ sigTermHandler(SIGNAL_ARGS) /* * Some platforms allow delivery of new signals to interrupt an active * signal handler. That could muck up our attempt to send PQcancel, so - * disable the signals that setup_cancel_handler enabled. + * disable the signals that pg_dump_setup_cancel_handler enabled. */ pqsignal(SIGINT, SIG_IGN); pqsignal(SIGTERM, SIG_IGN); @@ -605,7 +605,7 @@ sigTermHandler(SIGNAL_ARGS) * Enable cancel interrupt handler, if not already done. */ static void -setup_cancel_handler(void) +pg_dump_setup_cancel_handler(void) { /* * When forking, signal_info.handler_set will propagate into the new @@ -705,7 +705,7 @@ consoleHandler(DWORD dwCtrlType) * Enable cancel interrupt handler, if not already done. */ static void -setup_cancel_handler(void) +pg_dump_setup_cancel_handler(void) { if (!signal_info.handler_set) { @@ -737,7 +737,7 @@ set_archive_cancel_info(ArchiveHandle *AH, PGconn *conn) * important that this happen at least once before we fork off any * threads. */ - setup_cancel_handler(); + pg_dump_setup_cancel_handler(); /* * On Unix, we assume that storing a pointer value is atomic with respect --Multipart=_Fri__26_Jan_2024_09_42_45_+0900_0Jj14cgvrqk51+Fd--