Tarantool development patches archive
 help / color / mirror / Atom feed
From: Leonid Vasiliev <lvasiliev@tarantool.org>
To: alexander.turenko@tarantool.org
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH] Fix take a task after disconnect
Date: Mon, 16 Dec 2019 12:01:01 +0300	[thread overview]
Message-ID: <e1625d2e-578d-f618-e299-3c2e8aabfbdd@tarantool.org> (raw)
In-Reply-To: <0a45779911c6218147511037fc022aad8af69709.1576485088.git.lvasiliev@tarantool.org>

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)
> 

  reply	other threads:[~2019-12-16  9:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-16  8:33 Leonid Vasiliev
2019-12-16  9:01 ` Leonid Vasiliev [this message]
2019-12-16 13:07   ` Leonid Vasiliev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e1625d2e-578d-f618-e299-3c2e8aabfbdd@tarantool.org \
    --to=lvasiliev@tarantool.org \
    --cc=alexander.turenko@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH] Fix take a task after disconnect' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox