diff mbox

[ovs-dev] ovsdb: use more descriptive error message

Message ID 1470251258-2758-1-git-send-email-rmoats@us.ibm.com
State Accepted
Headers show

Commit Message

Ryan Moats Aug. 3, 2016, 7:07 p.m. UTC
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 <rmoats@us.ibm.com>
Reported-by: Ryan Moats <rmoats@us.ibm.com>
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(-)

Comments

Ben Pfaff Aug. 14, 2016, 5:11 a.m. UTC | #1
On Wed, Aug 03, 2016 at 07:07:38PM +0000, Ryan Moats wrote:
> 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 <rmoats@us.ibm.com>
> Reported-by: Ryan Moats <rmoats@us.ibm.com>
> Reported-at: http://openvswitch.org/pipermail/dev/2016-August/077083.html
> Fixes: f85f8ebb ("Initial implementation of OVSDB.")

Applied, thanks!
diff mbox

Patch

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],