Skip to content

Bug with "limfifottl" queues when capacity is reached #21

Description

@PavelFil

Create a queue

queue = require 'queue'
queue.create_tube('test', 'limfifottl', {capacity = 1})

Next add records:

$queue = new Queue($client, 'test');
$result = $queue->put(45);
var_dump($result);
$result = $queue->put(45);
var_dump($result);

Output:

object(Tarantool\Queue\Task)#26 (3) {
  ["id":"Tarantool\Queue\Task":private]=>
  int(0)
  ["state":"Tarantool\Queue\Task":private]=>
  string(1) "r"
  ["data":"Tarantool\Queue\Task":private]=>
  int(45)
}
PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Tarantool\Queue\Task::fromTuple() must be of the type array, null given, called in /vendor/tarantool/queue/src/Queue.php on line 45 and defined in /vendor/tarantool/queue/src/Task.php:34
Stack trace:
#0 /vendor/tarantool/queue/src/Queue.php(45): Tarantool\Queue\Task::fromTuple(NULL)
#1 /test.php(60): Tarantool\Queue\Queue->put(45)
#2 {main}
  thrown in /vendor/tarantool/queue/src/Task.php on line 34

Expected output:

object(Tarantool\Queue\Task)#26 (3) {
  ["id":"Tarantool\Queue\Task":private]=>
  int(0)
  ["state":"Tarantool\Queue\Task":private]=>
  string(1) "r"
  ["data":"Tarantool\Queue\Task":private]=>
  int(45)
}
NULL

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions