[Tarantool-patches] [PATCH 03/20] net.box: do not check worker_fiber in request:result, is_ready

Vladimir Davydov vdavydov at tarantool.org
Fri Jul 23 14:07:13 MSK 2021


request.id and request.errno are set appropriately whenever a connection
is closed so there's no need to check if worker_fiber is running. We do
not want to have this check in request methods so that we can move its
implementation to C, where worker_fiber isn't (and won't be) available.
---
 src/box/lua/net_box.lua | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/box/lua/net_box.lua b/src/box/lua/net_box.lua
index cacb7473deb0..fc8468ed8a01 100644
--- a/src/box/lua/net_box.lua
+++ b/src/box/lua/net_box.lua
@@ -295,7 +295,7 @@ local function create_transport(host, port, user, password, callback,
     -- dispatcher.
     --
     function request_index:is_ready()
-        return self.id == nil or worker_fiber == nil
+        return self.id == nil
     end
     --
     -- When a request is finished, a result can be got from a
@@ -315,8 +315,6 @@ local function create_transport(host, port, user, password, callback,
             return nil, self.response
         elseif not self.id then
             return self.response
-        elseif not worker_fiber then
-            return nil, box.error.new(E_NO_CONNECTION)
         else
             return nil, box.error.new(box.error.PROC_LUA,
                                       'Response is not ready')
-- 
2.25.1



More information about the Tarantool-patches mailing list