Skip to content

server:exec() silently ignores malformed arguments #230

@sergepetrenko

Description

@sergepetrenko

For example, I want to change box.cfg on some node:

server:exec(function(cfg) box.cfg(cfg) end, {replication = 'something'})

I made an error in the code above. The arguments should be passed as a table, and my argument is a table itself, so I should've written {{replication = 'something'}} with extra braces.

Anyway, my example above runs just fine and produces zero errors and zero output in tarantool logs (as well as has zero effect).

The reason for that is exec using unpack to unpack the args table,
and unpack ignores map-like parts of the table:

tarantool> unpack{replication="something"}
---
...

tarantool> unpack{1,2, replication="something", 4}
---
- 1
- 2
- 4
...

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions