Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH] Fix take a task after disconnect
@ 2019-12-16  8:33 Leonid Vasiliev
  2019-12-16  9:01 ` Leonid Vasiliev
  0 siblings, 1 reply; 3+ messages in thread
From: Leonid Vasiliev @ 2019-12-16  8:33 UTC (permalink / raw)
  To: alexander.turenko; +Cc: tarantool-patches

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Tarantool-patches] [PATCH] Fix take a task after disconnect
  2019-12-16  8:33 [Tarantool-patches] [PATCH] Fix take a task after disconnect Leonid Vasiliev
@ 2019-12-16  9:01 ` Leonid Vasiliev
  2019-12-16 13:07   ` Leonid Vasiliev
  0 siblings, 1 reply; 3+ messages in thread
From: Leonid Vasiliev @ 2019-12-16  9:01 UTC (permalink / raw)
  To: alexander.turenko; +Cc: tarantool-patches

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Tarantool-patches] [PATCH] Fix take a task after disconnect
  2019-12-16  9:01 ` Leonid Vasiliev
@ 2019-12-16 13:07   ` Leonid Vasiliev
  0 siblings, 0 replies; 3+ messages in thread
From: Leonid Vasiliev @ 2019-12-16 13:07 UTC (permalink / raw)
  To: alexander.turenko; +Cc: tarantool-patches

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-12-16 13:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-16  8:33 [Tarantool-patches] [PATCH] Fix take a task after disconnect Leonid Vasiliev
2019-12-16  9:01 ` Leonid Vasiliev
2019-12-16 13:07   ` Leonid Vasiliev

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