Closed
Description
How to reproduce:
- Get into the docker container and add a task:
docker-compose exec tnt1 tarantoolctl connect /var/run/tarantool/tarantool.sock
queue.tube.default:put({test=true})
---
- [0, 'r', {'test': true}]
...
- Take a task:
queue.tube.default:take()
---
- [0, 't', {'test': true}]
...
- Restart container:
docker-compose restart tnt1
- Check task status:
queue.tube.default:peek(0)
---
- [0, 't', {'test': true}]
...
The issue can be reproduced with connectors:
https://github.com/igorcoding/asynctnt-queue:
import asyncio
import asynctnt
import asynctnt_queue
import sys
async def run():
conn = asynctnt.Connection(host='tnt1', port=3301, username='tnt1', password='tnt1')
await conn.connect()
queue = asynctnt_queue.Queue(conn)
test_tube = queue.tube('default')
# Retrieve a task from queue
task = await test_tube.take(1)
print(task)
# Restart Tarantool here
sys.stdin.readline()
await conn.disconnect()
loop = asyncio.get_event_loop()
loop.run_until_complete(run())
https://github.com/tarantool-php/queue:
<?php
$conn = new \Tarantool\Client\Connection\StreamConnection('tcp://127.0.0.1:3301');
$client = new \Tarantool\Client\Client($conn, new \Tarantool\Client\Packer\PurePacker());
$client->authenticate('tnt1', 'tnt1');
$queue = new \Tarantool\Queue\Queue($client, 'default');
$task = $queue->take(1);
var_dump($task);
readline('Restart Tarantool and press a key to continue');
Here is the simplified instance configuration:
box.cfg {
listen = 3301,
log_level = 5
}
local config = {
user = 'tnt1',
password = 'tnt1'
}
if not box.schema.user.exists(config.user) then
box.schema.user.create(config.user, {password = config.password})
box.schema.user.grant(config.user, 'read,write,execute', 'universe', nil)
end
queue = require('queue')
box.once('foobar:v0.1.0', function()
queue.create_tube('default', 'fifottl', {if_not_exists = true})
end)