Skip to content

Commit

Permalink
ovsdb: Use better error message for "timeout" without waiting.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reported-by: Ryan Moats <[email protected]>
Reported-at: http://openvswitch.org/pipermail/dev/2016-August/077083.html
Fixes: f85f8eb ("Initial implementation of OVSDB.")
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
jayhawk87 authored and blp committed Aug 14, 2016
1 parent 0deb0f6 commit cd423a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion ovsdb/execution.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions tests/ovsdb-execution.at
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand All @@ -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],
Expand All @@ -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],
Expand Down

0 comments on commit cd423a7

Please sign in to comment.