diff --git a/changelogs/unreleased/gh-6144-incorrect-timeout-error.md b/changelogs/unreleased/gh-6144-incorrect-timeout-error.md new file mode 100644 index 0000000000000000000000000000000000000000..61671a758dd5e4c662dd4c6fe6244591ff6c23c4 --- /dev/null +++ b/changelogs/unreleased/gh-6144-incorrect-timeout-error.md @@ -0,0 +1,4 @@ +## bugfix/net.box + +* Changed the type of the error returned by net.box on timeout + from ClientError to TimedOut (gh-6144). diff --git a/src/box/lua/net_box.c b/src/box/lua/net_box.c index 74cb67a272671f76e816afe8cec6130b109e86dc..a04e3329be59dd3efbf9e4d3fdb3dc0a1ba5d36e 100644 --- a/src/box/lua/net_box.c +++ b/src/box/lua/net_box.c @@ -1841,7 +1841,7 @@ luaT_netbox_request_wait_result(struct lua_State *L) while (!netbox_request_is_ready(request)) { if (!netbox_request_wait(request, &timeout)) { luaL_testcancel(L); - diag_set(ClientError, ER_TIMEOUT); + diag_set(TimedOut); return luaT_push_nil_and_error(L); } } @@ -1931,7 +1931,7 @@ luaT_netbox_request_iterator_next(struct lua_State *L) do { if (!netbox_request_wait(request, &timeout)) { luaL_testcancel(L); - diag_set(ClientError, ER_TIMEOUT); + diag_set(TimedOut); luaT_push_nil_and_error(L); goto error; } @@ -2132,7 +2132,7 @@ luaT_netbox_transport_perform_request(struct lua_State *L) netbox_request_unregister(&request); netbox_request_destroy(&request); luaL_testcancel(L); - diag_set(ClientError, ER_TIMEOUT); + diag_set(TimedOut); return luaT_push_nil_and_error(L); } } diff --git a/test/box/net.box_count_inconsistent_gh-3262.result b/test/box/net.box_count_inconsistent_gh-3262.result index 286f9ded8aeac413a5609c06995142a4806ee89d..6ce1c3b5c75cde4f48e720c166af7f03deb551fc 100644 --- a/test/box/net.box_count_inconsistent_gh-3262.result +++ b/test/box/net.box_count_inconsistent_gh-3262.result @@ -120,7 +120,7 @@ remote_space:insert({0}, { timeout = 1.00 }) ... remote_space:insert({1}, { timeout = 1e-9 }) --- -- error: Timeout exceeded +- error: timed out ... remote_space:insert({2}) --- @@ -128,7 +128,7 @@ remote_space:insert({2}) ... remote_space:replace({0}, { timeout = 1e-9 }) --- -- error: Timeout exceeded +- error: timed out ... remote_space:replace({1}) --- @@ -140,7 +140,7 @@ remote_space:replace({2}, { timeout = 1.00 }) ... remote_space:upsert({3}, {}, { timeout = 1e-9 }) --- -- error: Timeout exceeded +- error: timed out ... remote_space:upsert({4}, {}) --- @@ -153,7 +153,7 @@ remote_space:upsert({3}, {}) ... remote_space:update({3}, {}, { timeout = 1e-9 }) --- -- error: Timeout exceeded +- error: timed out ... remote_space:update({4}, {}) --- @@ -169,7 +169,7 @@ remote_space:update({3}, {}) ... remote_pk:update({5}, {}, { timeout = 1e-9 }) --- -- error: Timeout exceeded +- error: timed out ... remote_pk:update({4}, {}) --- @@ -193,11 +193,11 @@ remote_space:get({1}, { timeout = 1.00 }) ... remote_space:get({2}, { timeout = 1e-9 }) --- -- error: Timeout exceeded +- error: timed out ... remote_pk:get({3}, { timeout = 1e-9 }) --- -- error: Timeout exceeded +- error: timed out ... remote_pk:get({4}) --- @@ -209,7 +209,7 @@ remote_pk:get({5}, { timeout = 1.00 }) ... remote_space:select({2}, { timeout = 1e-9 }) --- -- error: Timeout exceeded +- error: timed out ... remote_space:select({2}, { timeout = 1.00 }) --- @@ -225,7 +225,7 @@ remote_pk:select({2}, { timeout = 1.00 }) ... remote_pk:select({2}, { timeout = 1e-9 }) --- -- error: Timeout exceeded +- error: timed out ... remote_pk:select({2}) --- @@ -249,7 +249,7 @@ remote_space:select({5}, { iterator = 'LE', limit = 5}) ... remote_space:select({5}, { timeout = 1e-9, iterator = 'LE', limit = 5 }) --- -- error: Timeout exceeded +- error: timed out ... remote_pk:select({2}, { timeout = 1.00, iterator = 'LE', limit = 5 }) --- @@ -265,7 +265,7 @@ remote_pk:select({2}, { iterator = 'LE', limit = 5}) ... remote_pk:select({2}, { timeout = 1e-9, iterator = 'LE', limit = 5 }) --- -- error: Timeout exceeded +- error: timed out ... remote_pk:count({2}, { timeout = 1.00}) --- @@ -273,7 +273,7 @@ remote_pk:count({2}, { timeout = 1.00}) ... remote_pk:count({2}, { timeout = 1e-9}) --- -- error: Timeout exceeded +- error: timed out ... remote_pk:count({2}) --- @@ -289,7 +289,7 @@ remote_pk:count({2}, { iterator = 'LE'}) ... remote_pk:count({2}, { timeout = 1e-9, iterator = 'LE' }) --- -- error: Timeout exceeded +- error: timed out ... remote_pk:min(nil, { timeout = 1.00 }) --- @@ -297,7 +297,7 @@ remote_pk:min(nil, { timeout = 1.00 }) ... remote_pk:min(nil, { timeout = 1e-9 }) --- -- error: Timeout exceeded +- error: timed out ... remote_pk:min(nil) --- @@ -305,7 +305,7 @@ remote_pk:min(nil) ... remote_pk:min({0}, { timeout = 1e-9 }) --- -- error: Timeout exceeded +- error: timed out ... remote_pk:min({1}) --- @@ -321,7 +321,7 @@ remote_pk:max(nil) ... remote_pk:max(nil, { timeout = 1e-9 }) --- -- error: Timeout exceeded +- error: timed out ... remote_pk:max(nil, { timeout = 1.00 }) --- @@ -333,7 +333,7 @@ remote_pk:max({0}, { timeout = 1.00 }) ... remote_pk:max({1}, { timeout = 1e-9 }) --- -- error: Timeout exceeded +- error: timed out ... remote_pk:max({2}) --- @@ -371,7 +371,7 @@ test_run:cmd("setopt delimiter ''"); ... _ = remote_space:delete({0}, { timeout = 1e-9 }) --- -- error: Timeout exceeded +- error: timed out ... _ = remote_pk:delete({0}, { timeout = 1.00 }) --- @@ -381,11 +381,11 @@ _ = remote_space:delete({1}, { timeout = 1.00 }) ... _ = remote_pk:delete({1}, { timeout = 1e-9 }) --- -- error: Timeout exceeded +- error: timed out ... _ = remote_space:delete({2}, { timeout = 1e-9 }) --- -- error: Timeout exceeded +- error: timed out ... _ = remote_pk:delete({2}) --- @@ -417,7 +417,7 @@ cn:call('ret_after', {0.01}, { timeout = 1.00 }) ... cn:call('ret_after', {1.00}, { timeout = 1e-9 }) --- -- error: Timeout exceeded +- error: timed out ... cn:eval('return ret_after(...)', {0.01}, { timeout = 1.00 }) --- @@ -425,7 +425,7 @@ cn:eval('return ret_after(...)', {0.01}, { timeout = 1.00 }) ... cn:eval('return ret_after(...)', {1.00}, { timeout = 1e-9 }) --- -- error: Timeout exceeded +- error: timed out ... cn:close() --- diff --git a/test/box/net.box_discard_gh-3107.result b/test/box/net.box_discard_gh-3107.result index 370a87c524b462b98e75c2a5b3e16783b099420c..8967844c484e3c898aada17fd6ed709ee62f33ea 100644 --- a/test/box/net.box_discard_gh-3107.result +++ b/test/box/net.box_discard_gh-3107.result @@ -65,7 +65,7 @@ for i = 1, 10 do fiber.create(function() ret[i] = future:wait_result(1000) count future:wait_result(0.01) -- Must fail on timeout. --- - null -- Timeout exceeded +- timed out ... finalize_long() --- diff --git a/test/box/net.box_fiber-async_gh-3107.result b/test/box/net.box_fiber-async_gh-3107.result index 98c9af953efaa43e0c1f1670a5392fc114b50786..c5110810510f5973c9e36cdc44acb1c9640ba53d 100644 --- a/test/box/net.box_fiber-async_gh-3107.result +++ b/test/box/net.box_fiber-async_gh-3107.result @@ -62,7 +62,7 @@ future:is_ready() future:wait_result(0.01) -- Must fail on timeout. --- - null -- Timeout exceeded +- timed out ... finalize_long() --- @@ -128,7 +128,7 @@ assert_no_csw(future.result, future) assert_no_csw(future.wait_result, future, 0) --- - null -- Timeout exceeded +- timed out ... finalize_long() --- diff --git a/test/box/net.box_methods_gh-3107.result b/test/box/net.box_methods_gh-3107.result index d20da1c37d223fe82405cbd6885d3b62093fa67c..99a5b4a89862657a16d5d0d64f74a769dc305c2f 100644 --- a/test/box/net.box_methods_gh-3107.result +++ b/test/box/net.box_methods_gh-3107.result @@ -65,7 +65,7 @@ for i = 1, 10 do fiber.create(function() ret[i] = future:wait_result(1000) count future:wait_result(0.01) -- Must fail on timeout. --- - null -- Timeout exceeded +- timed out ... finalize_long() --- diff --git a/test/box/net.box_raw_response_gh-3107.result b/test/box/net.box_raw_response_gh-3107.result index 85fef9daf7094e1f511d92d84c65e18282223535..1208341d572833910f4c6fabd56014ff63aefe07 100644 --- a/test/box/net.box_raw_response_gh-3107.result +++ b/test/box/net.box_raw_response_gh-3107.result @@ -68,7 +68,7 @@ for i = 1, 10 do fiber.create(function() ret[i] = future:wait_result(1000) count future:wait_result(0.01) -- Must fail on timeout. --- - null -- Timeout exceeded +- timed out ... finalize_long() --- diff --git a/test/box/net.box_schema_change_gh-3107.result b/test/box/net.box_schema_change_gh-3107.result index 233c83307acdcafa2f2af06f2e2166da18d5c55e..dd2e51f8fd0997351cafa073b60d8ff40db70196 100644 --- a/test/box/net.box_schema_change_gh-3107.result +++ b/test/box/net.box_schema_change_gh-3107.result @@ -65,7 +65,7 @@ for i = 1, 10 do fiber.create(function() ret[i] = future:wait_result(1000) count future:wait_result(0.01) -- Must fail on timeout. --- - null -- Timeout exceeded +- timed out ... finalize_long() --- diff --git a/test/box/net.box_timeout-gh-3107.result b/test/box/net.box_timeout-gh-3107.result index be7f9606ce38a2b23c791d03411fb3f8e21cce09..b2cabe2bc3094eeb9e7d0b70bc15d4e9edf6e443 100644 --- a/test/box/net.box_timeout-gh-3107.result +++ b/test/box/net.box_timeout-gh-3107.result @@ -89,7 +89,7 @@ future:result() future:wait_result(0.01) -- Must fail on timeout. | --- | - null - | - Timeout exceeded + | - timed out | ... finalize_long() | ---