Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bLmO9-0006we-5D for pgsql-hackers@arkaria.postgresql.org; Sat, 09 Jul 2016 07:09:21 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bLmO8-0006IV-H4 for pgsql-hackers@arkaria.postgresql.org; Sat, 09 Jul 2016 07:09:20 +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 1bLmO6-0006IE-Ri for pgsql-hackers@postgresql.org; Sat, 09 Jul 2016 07:09:18 +0000 Received: from jiboia.ensmp.fr ([194.214.158.137]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bLmNy-0004PN-9M for pgsql-hackers@postgresql.org; Sat, 09 Jul 2016 07:09:16 +0000 Received: from cri.ensmp.fr (AGrenoble-653-1-69-83.w92-129.abo.wanadoo.fr [92.129.7.83]) (authenticated bits=0) by jiboia.ensmp.fr (8.15.2/8.15.1/JMMC-22/Oct/2013) with ESMTPSA id u69794ox000709 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sat, 9 Jul 2016 09:09:05 +0200 Date: Sat, 9 Jul 2016 09:09:03 +0200 (CEST) From: Fabien COELHO X-X-Sender: fabien@sto Reply-To: Fabien COELHO To: PostgreSQL Developers Subject: pgbench - minor fix for meta command only scripts Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-32296658-1468048146=:3412" X-Miltered: at jiboia.ensmp.fr with ID 5780A310.000 by Joe's j-chkmail (http : // j-chkmail dot ensmp dot fr)! X-j-chkmail-Auth: USER-ID fabien.coelho X-j-chkmail-Enveloppe: 5780A310.000 from AGrenoble-653-1-69-83.w92-129.abo.wanadoo.fr/AGrenoble-653-1-69-83.w92-129.abo.wanadoo.fr/92.129.7.83/cri.ensmp.fr/ X-Pg-Spam-Score: -3.2 (---) 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 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-32296658-1468048146=:3412 Content-Type: text/plain; format=flowed; charset=US-ASCII While testing meta-command pgbench only scripts, I noticed that there is an infinite loop in threadRun, which means that other tasks such as reporting progress do not get a chance. The attached patch breaks this loop by always returning at the end of a script. On "pgbench -T 3 -P 1 -f noop.sql", before this patch, the progress is not shown, after it is. -- Fabien. --8323329-32296658-1468048146=:3412 Content-Type: application/x-sql; name=pgbench-no-sql-fix-1.sql Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=pgbench-no-sql-fix-1.sql ZGlmZiAtLWdpdCBhL3NyYy9iaW4vcGdiZW5jaC9wZ2JlbmNoLmMgYi9zcmMv YmluL3BnYmVuY2gvcGdiZW5jaC5jCmluZGV4IDg3ZmIwMDYuLmQwNmY1ODEg MTAwNjQ0Ci0tLSBhL3NyYy9iaW4vcGdiZW5jaC9wZ2JlbmNoLmMKKysrIGIv c3JjL2Jpbi9wZ2JlbmNoL3BnYmVuY2guYwpAQCAtMjE3Miw4ICsyMTcyLDE0 IEBAIHRvcDoKIAkJCQlzdC0+bGlzdGVuID0gdHJ1ZTsKIAkJfQogCi0JCS8q IGFmdGVyIGEgbWV0YSBjb21tYW5kLCBpbW1lZGlhdGVseSBwcm9jZWVkIHdp dGggbmV4dCBjb21tYW5kICovCi0JCWdvdG8gdG9wOworCQkvKgorCQkgKiBB ZnRlciBhIG1ldGEgY29tbWFuZCwgaW1tZWRpYXRlbHkgcHJvY2VlZCB3aXRo IG5leHQgY29tbWFuZC4uLgorCQkgKiBhbHRob3VnaCBub3QgaWYgbGFzdC4g VGhpcyBleGNlcHRpb24gZW5zdXJlcyB0aGF0IGEgbWV0YSBjb21tYW5kCisJ CSAqIG9ubHkgc2NyaXB0IGRvZXMgbm90IGFsd2F5cyBsb29wIGluIGRvQ3Vz dG9tLCBzbyB0aGF0IG90aGVyIHRhc2tzCisJCSAqIGluIHRocmVhZFJ1biwg ZWcgcHJvZ3Jlc3MgcmVwb3J0aW5nIG9yIHN3aXRjaGluZyBjbGllbnQsIGdl dCBhIGNoYW5jZS4KKwkJICovCisJCWlmIChjb21tYW5kc1tzdC0+c3RhdGUg KyAxXSAhPSBOVUxMKQorCQkJZ290byB0b3A7CiAJfQogCiAJcmV0dXJuIHRy dWU7Cg== --8323329-32296658-1468048146=:3412 Content-Type: application/x-sql; name=noop.sql Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=noop.sql XHNldCBvbmUgMQo= --8323329-32296658-1468048146=:3412 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --8323329-32296658-1468048146=:3412--