Skip to content

Commit

Permalink
bugfix: call queue.cfg() before box.cfg()
Browse files Browse the repository at this point in the history
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
  • Loading branch information
oleg-jukovec committed May 17, 2023
1 parent 3802c79 commit 53606f0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions queue/example_connection_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ func (h *QueueConnectionHandler) Discovered(conn *tarantool.Connection,

// Set up a queue module configuration for an instance.
q := queue.New(conn, h.name)

// Set up a queue module configuration for an instance. Ideally, this
// should be done before box.cfg({}) or you need to wait some time
// before start a work.
//
// See:
// https://github.com/tarantool/queue/issues/206
opts := queue.CfgOpts{InReplicaset: true, Ttr: 60 * time.Second}

if h.err = q.Cfg(opts); h.err != nil {
Expand Down
3 changes: 3 additions & 0 deletions queue/testdata/pool.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ end

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

local listen = os.getenv("TEST_TNT_LISTEN")
box.cfg{
Expand Down

0 comments on commit 53606f0

Please sign in to comment.