tarantool / tarantool/tarantool

Check function arguments in IPROTO

Open
#12,515 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

app feature iproto
Dominant language
Lua
Stars
3.7k
Forks
419
Avg merge
1d 23h
Merged PRs (30d)
88

Description

IPROTO doesn't check arguments passed to a function executed with IPROTO_CALL. This is supposed to be done by the function implementation, but doing it in the main thread may negatively affect performance. It'd be nice if this job could be offloaded to IPROTO threads, because the number of IPROTO threads is configurable and typically they are less loaded than the transaction processing thread.

Now, that we have box.iproto.export() (#10036), we can pass the arguments schema to it when exporting a function. The schema could be "compiled" and passed to IPROTO, where function arguments would be checked against it. We could also verify the return value and raised errors in the "debug" mode.

See also #11760.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing box.iproto.export() behavior from #10036 and the IPROTO_CALL path described here, then compare the related discussion in #11760. Define how an exported function's argument schema reaches IPROTO threads and how validation, including optional debug-mode return and error checks, should be verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
backend-api-design, database, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.