From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 735B222626 for ; Mon, 23 Apr 2018 14:59:22 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nk_nzR-J_df1 for ; Mon, 23 Apr 2018 14:59:22 -0400 (EDT) Received: from smtp44.i.mail.ru (smtp44.i.mail.ru [94.100.177.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 32D52225DC for ; Mon, 23 Apr 2018 14:59:21 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH 6/8] netbox: introduce fiber-async API References: <49a50d32a154959aa786ec2a85a4f74792d7ae09.1523903144.git.v.shpilevoy@tarantool.org> <20180423123108.ensm2xcd3onbfnpu@tkn_work_nb> From: Vladislav Shpilevoy Message-ID: Date: Mon, 23 Apr 2018 21:59:19 +0300 MIME-Version: 1.0 In-Reply-To: <20180423123108.ensm2xcd3onbfnpu@tkn_work_nb> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org, Alexander Turenko Hello. Thanks for review! On 23/04/2018 15:31, Alexander Turenko wrote: > Hi Vlad! > > Minor wording comments are below (Vlad asks to track it here). > > WBR, Alexander Turenko. > > On Mon, Apr 16, 2018 at 09:39:16PM +0300, Vladislav Shpilevoy wrote: >> Now any netbox call blocks a caller-fiber until a result is read >> from a socket, or time is out. To use it asynchronously it is >> necessary to create a fiber per request. Sometimes it is >> unwanted - for example if RPS is very high (for example, about >> 100k), and latency is about 1 second. Or when it is neccessary >> to send multiple requests in paralles and then collect responses >> (map-reduce). > > Paralles -> parallel. > >> + function request_index:wait_result(timeout) >> ... >> + if not self:is_ready() then >> + -- When a response is ready before timeout, the >> + -- waiting client is waked up spuriously. > > Do you mean prematurely? Fixed on branch. diff --git a/src/box/lua/net_box.lua b/src/box/lua/net_box.lua index 85f31b8e8..e3680006e 100644 --- a/src/box/lua/net_box.lua +++ b/src/box/lua/net_box.lua @@ -286,7 +286,7 @@ local function create_transport(host, port, user, password, callback, end if not self:is_ready() then -- When a response is ready before timeout, the - -- waiting client is waked up spuriously. + -- waiting client is waked up prematurely. local old_client = self.client self.client = fiber.self() while timeout > 0 and not self:is_ready() do