Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lsivK-0007Cu-9o for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Jun 2021 09:30:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lsivI-00037Y-0K for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Jun 2021 09:30:24 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lsivH-00037P-P3 for pgsql-hackers@lists.postgresql.org; Mon, 14 Jun 2021 09:30:23 +0000 Received: from sfr-1.cri.mines-paristech.fr ([77.158.180.225] helo=smtp.cri.ensmp.fr) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lsivA-0007PK-OM for pgsql-hackers@lists.postgresql.org; Mon, 14 Jun 2021 09:30:22 +0000 Received: from petersbourg.cri.ensmp.fr (petersbourg.cri.ensmp.fr [10.2.14.5]) by smtp.cri.ensmp.fr (Postfix) with ESMTPSA id 4E3FCC019D; Mon, 14 Jun 2021 11:32:08 +0200 (CEST) Date: Mon, 14 Jun 2021 11:30:14 +0200 (CEST) From: Fabien COELHO X-X-Sender: fabien@pseudo To: Yugo NAGATA cc: "kuroda.hayato@fujitsu.com" , "'pgsql-hackers@lists.postgresql.org'" Subject: Re: pgbench bug candidate: negative "initial connection time" In-Reply-To: <20210614170702.af28e1eeaa055a818f5880e0@sraoss.co.jp> Message-ID: References: <20210614170702.af28e1eeaa055a818f5880e0@sraoss.co.jp> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk >>> Hmmm. Possibly. Another option could be not to report anything after some >>> errors. I'm not sure, because it would depend on the use case. I guess the >>> command returned an error status as well. >> >> I did not know any use cases and decisions , but I vote to report nothing when error occurs. > > I would prefer to abort the thread whose connection got an error and report > results for other threads, as handled when doConnect fails in CSTATE_START_TX > state. It is unclear to me whether it makes much sense to report performance when things go wrong. At least when a one connection per client bench is run ISTM that it should not proceed, because the bench could not even start as prescribe. When connection break while the bench has already started, maybe it makes more sense to proceed, although I guess that maybe reattempting connections would make also sense in such case. > In this case, we have to set the state to CSTATE_ABORT before going to 'done' > as fixed in the attached patch, in order to ensure that exit status is 2 and the > result reports "pgbench: fatal: Run was aborted; the above results are incomplete." Hmmm. I agree that at least reporting that there was an issue is a good idea. > Otherwise, if we want pgbench to exit immediately when a connection error occurs, > we have tocall exit(1) to ensure the exit code is 1, of course. Anyway, it is wrong > that thecurrent pgbench exit successfully with exit code 0 when doConnnect fails. Indeed, I can only agree on this one. -- Fabien.