From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id B9A9F46970E for ; Mon, 16 Dec 2019 16:07:35 +0300 (MSK) From: Leonid Vasiliev References: <0a45779911c6218147511037fc022aad8af69709.1576485088.git.lvasiliev@tarantool.org> Message-ID: Date: Mon, 16 Dec 2019 16:07:34 +0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [Tarantool-patches] [PATCH] Fix take a task after disconnect List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: alexander.turenko@tarantool.org Cc: tarantool-patches@dev.tarantool.org I am sorry. It's a wrong patch. On 12/16/19 12:01 PM, Leonid Vasiliev wrote: > Update: > --- > --- a/queue/abstract.lua > +++ b/queue/abstract.lua > @@ -96,6 +96,8 @@ function tube.take(self, timeout) > >          if session.exists(sid) then >              task = self.raw:take() > +        else > +            return nil >          end > >          if task ~= nil then > > On 12/16/19 11:33 AM, Leonid Vasiliev wrote: >> https://github.com/tarantool/queue/issues/104 >> https://github.com/tarantool/queue/tree/lvasiliev/gh-queue-104-take-task-after-disconnect >> >> >> --- >>   queue/abstract.lua | 4 +++- >>   1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/queue/abstract.lua b/queue/abstract.lua >> index ad8817d..e5cfa39 100644 >> --- a/queue/abstract.lua >> +++ b/queue/abstract.lua >> @@ -94,7 +94,9 @@ function tube.take(self, timeout) >>           conds[fid]:free() >>           box.space._queue_consumers:delete{ sid, fid } >> -        task = self.raw:take() >> +        if session.exists(sid) then >> +            task = self.raw:take() >> +        end >>           if task ~= nil then >>               return self.raw:normalize_task(task) >>