Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
PavelFil opened this issue Oct 20, 2022 · 0 comments
Open

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

PavelFil opened this issue Oct 20, 2022 · 0 comments

Comments

@PavelFil
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant