Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b8UPW-0007Hi-QK for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Jun 2016 15:19:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1b8UPW-0007st-4d for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Jun 2016 15:19:50 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1b8UPU-0007rz-PJ for pgsql-hackers@postgresql.org; Thu, 02 Jun 2016 15:19:48 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1b8UPS-0003J5-92 for pgsql-hackers@postgresql.org; Thu, 02 Jun 2016 15:19:47 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u52FJgtq013184; Thu, 2 Jun 2016 11:19:43 -0400 From: Tom Lane To: Kyotaro HORIGUCHI cc: pgsql-hackers@postgresql.org Subject: Re: Parallel pg_dump's error reporting doesn't work worth squat In-reply-to: <20160602.174941.256342236.horiguchi.kyotaro@lab.ntt.co.jp> References: <14603.1464369620@sss.pgh.pa.us> <20160531.180204.85313767.horiguchi.kyotaro@lab.ntt.co.jp> <7445.1464712190@sss.pgh.pa.us> <20160602.174941.256342236.horiguchi.kyotaro@lab.ntt.co.jp> Comments: In-reply-to Kyotaro HORIGUCHI message dated "Thu, 02 Jun 2016 17:49:41 +0900" Date: Thu, 02 Jun 2016 11:19:42 -0400 Message-ID: <13183.1464880782@sss.pgh.pa.us> X-Pg-Spam-Score: -3.3 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Kyotaro HORIGUCHI writes: > Apart from the invalid snapshot problem, I looked the patch > previously mentioned mainly for Windows. Thanks for looking! > Even though the threads started by beginthread cannot be > terminated cleanly from outside, but the whole process will soon > terminate anyway, so we could use TreminateThread. This seems > working. (Attached patch) Seems reasonable to me; I was unhappy about the lack of any direct equivalent to the child SIGTERMs that the Unix code does. > Is there any reason for the name "ourAH" not to be "myAH"? Don't much care, I'll change it. > setup_cancel_handler looks somewhat bizarre. It eventually works > only for the main process/thread and does nothing for workers. It > is enough to be run once before forking in ParalleBackupStart and > that makes handler_set unnecessary. No, because we also want it to work in non-parallel cases. As coded, we'll establish the handler whenever set_archive_cancel_info is first called, which will be in the first ConnectDatabase() call. It would be possible to do that someplace else maybe, but it would require more code changes than just attaching it to set_archive_cancel_info. > In EndDBCopyMode, the result of PQgetResult is abandoned. This > can leak memory and such usage is not seen elsewhere in the > source tree. Shouldn't we hold the result and PQclear it? (Mainly > as a convention, not for benefit.) There should never be any non-null result, so that seems like a waste of code to me. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers