Skip to content

Commit

Permalink
disable schema fetch for cartridge.pool connections
Browse files Browse the repository at this point in the history
Cartridge uses only netbox.call and eval. So seems we could safety
disable schema fetching for netbox. New Tarantool versions allows
to disable schema fetching to avoid additional pressure that
schema fetching creates.

See also tarantool/doc#2680
  • Loading branch information
olegrok committed Apr 27, 2022
1 parent 8895872 commit 6da53d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cartridge/pool.lua
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ local function connect(uri, opts)
end

conn, err = NetboxConnectError:pcall(netbox.connect,
_uri, {wait_connected = false}
_uri, {wait_connected = false, fetch_schema = false}
)
if err ~= nil then
return nil, err
Expand Down
7 changes: 7 additions & 0 deletions test/integration/pool_connect_test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ function g.test_identity()
opts = {
user = 'admin',
wait_connected = false,
fetch_schema = false,
},
})

Expand Down Expand Up @@ -135,3 +136,9 @@ function g.test_async_call_remote()
local future = conn:call('pcall', {'smth'}, {is_async = true})
t.assert_equals({future:wait_result()}, {{false, 'attempt to call a string value'}})
end

function g.test_schema_fetch()
t.skip_if(not helpers.tarantool_version_ge('2.10.0'))
local conn = pool.connect('localhost:13301')
t.assert_equals(conn.space, nil)
end

0 comments on commit 6da53d0

Please sign in to comment.