• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tarantool / tarantool / 6172206516
88%

Build:
DEFAULT BRANCH: master
Ran 13 Sep 2023 12:16PM UTC
Jobs 1
Files 496
Run time 25s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

13 Sep 2023 12:07PM UTC coverage: 86.42% (+0.05%) from 86.369%
6172206516

push

github

locker
lua/msgpack: add details to msgpack.decode error

With this patch, mp_check sets diag with detailed information about
the MsgPack decoding error. The diag includes the error reason, which is
appended to the error message, and the data offset, which is stored in
an error payload field. Possible error reasons are: truncated input,
junk after input, illegal code, invalid extension. In case of truncated
input, the error also includes the trunc_count payload field, which is
set to the number of missing MsgPack values. Failing to decode a MsgPack
extension adds two payload fields, ext_type and ext_len, and also an
error cause, which is set by the extension decoder. For all extensions
except the error extension, the error cause is just "cannot unpack FOO".
For the error extension, it includes a detailed cause pointing to the
error in the MsgPack data stored in the extension.

Currently, the mp_check error is reported only by the Lua msgapck
decoder while other mp_check users (e.g. xrow decoder) override it.
We may improve on this in future.

Examples:

tarantool> require('msgpack').decode('\x94\xc0')
---
- error: Invalid MsgPack - truncated input
...

tarantool> box.error.last():unpack()
---
- offset: 2
  code: 20
  base_type: ClientError
  type: ClientError
  trunc_count: 3
  message: Invalid MsgPack - truncated input
  trace:
  - file: ./src/box/msgpack.c
    line: 151
...

tarantool> require('msgpack').decode(string.char(
         >   130,  39, 170, 114, 101, 116, 117, 114, 110,  32,  46,
         >    46,  46,  33, 145, 199,  74,   3, 129,   0, 145, 134,
         >     0, 171,  67, 108, 105, 101, 110, 116,  69, 114, 114,
         >   111, 114,   1, 170,  99, 111, 110, 102, 105, 103,  46,
         >   108, 117,  97,   2, 211,   0,   0,   0,   0,   0,   0,
         >     0, 201,   3, 173,  85, 110, 107, 110, 111, 119, 110,
         >    32, 101, 114, 114, 111, 114,   4, 211,   0,   0,   0,
         >     0,   0,   0,   0,   0,   5, 211,   0,   0,   0,   0,... (continued)

64309 of 116018 branches covered (0.0%)

97 of 97 new or added lines in 3 files covered. (100.0%)

96136 of 111243 relevant lines covered (86.42%)

2636445.21 hits per line

Jobs
ID Job ID Ran Files Coverage
1 6172206516.1 13 Sep 2023 12:16PM UTC 0
86.42
GitHub Action Run
Source Files on build 6172206516
Detailed source file information is not available for this build.
  • Back to Repo
  • 2c8ad0c7 on github
  • Prev Build on master (#6159372208)
  • Next Build on master (#6172553745)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc