Skip to content

Commit 5a511ba

Browse files
committed
bugfix: call queue.cfg() before box.cfg()
We don't have stable results if queue.cfg({in_replicaset = true}) is called after box.cfg(). Probably it is expected [1]. 1. tarantool/queue#206 Part of #278
1 parent 579dea8 commit 5a511ba

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

queue/example_connection_pool_test.go

+7
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ func (h *QueueConnectionHandler) Discovered(conn *tarantool.Connection,
6161

6262
// Set up a queue module configuration for an instance.
6363
q := queue.New(conn, h.name)
64+
65+
// Set up a queue module configuration for an instance. Ideally, this
66+
// should be done before box.cfg({}) or you need to wait some time
67+
// before start a work.
68+
//
69+
// See:
70+
// https://github.com/tarantool/queue/issues/206
6471
opts := queue.CfgOpts{InReplicaset: true, Ttr: 60 * time.Second}
6572

6673
if h.err = q.Cfg(opts); h.err != nil {

queue/testdata/pool.lua

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ end
2525

2626
local queue = require('queue')
2727
rawset(_G, 'queue', queue)
28+
-- queue.cfg({in_replicaset = true}) should be called before box.cfg({})
29+
-- https://github.com/tarantool/queue/issues/206
30+
queue.cfg({in_replicaset = true, ttr = 60})
2831

2932
local listen = os.getenv("TEST_TNT_LISTEN")
3033
box.cfg{

0 commit comments

Comments
 (0)