From patchwork Wed Aug 3 19:07:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Moats X-Patchwork-Id: 655561 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3s4Mz55l0zz9sRZ for ; Thu, 4 Aug 2016 05:08:01 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 286701028C; Wed, 3 Aug 2016 12:07:54 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e3.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id 647D010273 for ; Wed, 3 Aug 2016 12:07:52 -0700 (PDT) Received: from bar5.cudamail.com (localhost [127.0.0.1]) by mx1e3.cudamail.com (Postfix) with ESMTPS id B82D7420401 for ; Wed, 3 Aug 2016 13:07:51 -0600 (MDT) X-ASG-Debug-ID: 1470251270-09eadd508428f70001-byXFYA Received: from mx3-pf2.cudamail.com ([192.168.14.1]) by bar5.cudamail.com with ESMTP id t7SO9olulwv2QB84 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 03 Aug 2016 13:07:50 -0600 (MDT) X-Barracuda-Envelope-From: stack@tombstone-01.cloud.svl.ibm.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.1 Received: from unknown (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by mx3-pf2.cudamail.com with ESMTPS (AES256-SHA encrypted); 3 Aug 2016 19:07:50 -0000 Received-SPF: none (mx3-pf2.cudamail.com: domain at tombstone-01.cloud.svl.ibm.com does not designate permitted sender hosts) X-Barracuda-Apparent-Source-IP: 148.163.156.1 X-Barracuda-RBL-IP: 148.163.156.1 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u73J42bQ025462 for ; Wed, 3 Aug 2016 15:07:49 -0400 Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.152]) by mx0a-001b2d01.pphosted.com with ESMTP id 24kkag0a5h-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 03 Aug 2016 15:07:49 -0400 Received: from localhost by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 3 Aug 2016 13:07:48 -0600 Received: from d03dlp03.boulder.ibm.com (9.17.202.179) by e34.co.us.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 3 Aug 2016 13:07:46 -0600 X-IBM-Helo: d03dlp03.boulder.ibm.com X-IBM-MailFrom: stack@tombstone-01.cloud.svl.ibm.com Received: from b01cxnp22035.gho.pok.ibm.com (b01cxnp22035.gho.pok.ibm.com [9.57.198.25]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 99E6A19D8052 for ; Wed, 3 Aug 2016 13:07:17 -0600 (MDT) Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u73J7fue57147532; Wed, 3 Aug 2016 19:07:42 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5CD55AE043; Wed, 3 Aug 2016 15:07:42 -0400 (EDT) Received: from localhost (unknown [9.30.183.40]) by b01ledav005.gho.pok.ibm.com (Postfix) with SMTP id 1A62EAE051; Wed, 3 Aug 2016 15:07:42 -0400 (EDT) Received: by localhost (Postfix, from userid 1000) id 7EF4760012; Wed, 3 Aug 2016 19:07:41 +0000 (UTC) X-CudaMail-Envelope-Sender: stack@tombstone-01.cloud.svl.ibm.com From: Ryan Moats To: dev@openvswitch.org X-CudaMail-MID: CM-V2-802040600 X-CudaMail-DTE: 080316 X-CudaMail-Originating-IP: 148.163.156.1 Date: Wed, 3 Aug 2016 19:07:38 +0000 X-ASG-Orig-Subj: [##CM-V2-802040600##][PATCH] ovsdb: use more descriptive error message X-Mailer: git-send-email 2.7.4 X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16080319-0016-0000-0000-00000456B6D1 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00005547; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000177; SDB=6.00739527; UDB=6.00347707; IPR=6.00512127; BA=6.00004642; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00012141; XFM=3.00000011; UTC=2016-08-03 19:07:47 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16080319-0017-0000-0000-000031B4C466 Message-Id: <1470251258-2758-1-git-send-email-rmoats@us.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-08-03_14:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1608030188 X-GBUdb-Analysis: 0, 148.163.156.1, Ugly c=0.385168 p=-0.285714 Source Normal X-MessageSniffer-Rules: 0-0-0-9256-c X-Barracuda-Connect: UNKNOWN[192.168.14.1] X-Barracuda-Start-Time: 1470251270 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.60 X-Barracuda-Spam-Status: No, SCORE=0.60 using global scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=4.0 tests=BSF_SC5_MJ1963, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.31725 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS 0.50 BSF_SC5_MJ1963 Custom Rule MJ1963 Subject: [ovs-dev] [PATCH] ovsdb: use more descriptive error message X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" When setting a where clause, if the timeout is set to a value of 0, the clause is tested once and if it fails, a message of '"wait" timed out' is returned. This can be misleading because there wasn't any real time, so change the message to '"where" clause test failed'. Signed-off-by: Ryan Moats Reported-by: Ryan Moats Reported-at: http://openvswitch.org/pipermail/dev/2016-August/077083.html Fixes: f85f8ebb ("Initial implementation of OVSDB.") --- ovsdb/execution.c | 3 ++- tests/ovsdb-execution.at | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ovsdb/execution.c b/ovsdb/execution.c index e972ce7..af0e655 100644 --- a/ovsdb/execution.c +++ b/ovsdb/execution.c @@ -697,7 +697,8 @@ ovsdb_execute_wait(struct ovsdb_execution *x, struct ovsdb_parser *parser, "\"wait\" timed out after %lld ms", x->elapsed_msec); } else { - error = ovsdb_error("timed out", "\"wait\" timed out"); + error = ovsdb_error("timed out", + "\"where\" clause test failed"); } } else { /* ovsdb_execute() will change this, if triggers really are diff --git a/tests/ovsdb-execution.at b/tests/ovsdb-execution.at index 94630bd..6e768d3 100644 --- a/tests/ovsdb-execution.at +++ b/tests/ovsdb-execution.at @@ -471,7 +471,7 @@ OVSDB_CHECK_EXECUTION([equality wait with extra row], "rows": [{"name": "zero", "number": 0}, {"name": "one", "number": 1}, {"name": "two", "number": 2}]}]]]], - [[[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]},{"details":"\"wait\" timed out","error":"timed out"}] + [[[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]},{"details":"\"where\" clause test failed","error":"timed out"}] ]]) OVSDB_CHECK_EXECUTION([equality wait with missing row], @@ -490,7 +490,7 @@ OVSDB_CHECK_EXECUTION([equality wait with missing row], "columns": ["name", "number"], "until": "==", "rows": [{"name": "one", "number": 1}]}]]]], - [[[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]},{"details":"\"wait\" timed out","error":"timed out"}] + [[[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]},{"details":"\"where\" clause test failed","error":"timed out"}] ]]) OVSDB_CHECK_EXECUTION([inequality wait with correct rows], @@ -510,7 +510,7 @@ OVSDB_CHECK_EXECUTION([inequality wait with correct rows], "until": "!=", "rows": [{"name": "zero", "number": 0}, {"name": "one", "number": 1}]}]]]], - [[[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]},{"details":"\"wait\" timed out","error":"timed out"}] + [[[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]},{"details":"\"where\" clause test failed","error":"timed out"}] ]]) OVSDB_CHECK_EXECUTION([inequality wait with extra row],