Commit 3ad7fae
committed
server: fix assertion error serialization in exec()
Commit e6a2093 ("Add error handling at the server instance") broke
assertion failure reporting in `server:exec()` in case verbose error
serialization is enabled in Tarantool (`box_error_serialize_verbose`
compatibility option is set to `new`).
The problem is with the verbose error serialization, a raw string raised
with `error()` is converted to an error object when marshalled through
IPROTO while the `server:exec()` code expects it to remain a string
because it encodes the original error in JSON. As a result, we get
a mangled error like
```
{"status":"fail","class":"LuatestError","message":"...some_test.lua:42: expected: a value evaluating to true, actual: false"} {"code":32,"type":"LuajitError","trace":[{"file":"./src/lua/utils.c","line":687}]}
```
instead of
```
...some_test.lua:42: expected: a value evaluating to true, actual: false
```
To fix this issue, we revert the JSON encoding hack introduced by the
aforementioned commit. In order not to reintroduce issue #242 fixed by
that commit, we simply rollback the active transaction (if any) in case
the executed function failed.
Closes #3761 parent 3a78617 commit 3ad7fae
3 files changed
+34
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
742 | 742 | | |
743 | 743 | | |
744 | 744 | | |
745 | | - | |
746 | | - | |
| 745 | + | |
747 | 746 | | |
748 | 747 | | |
749 | 748 | | |
| |||
824 | 823 | | |
825 | 824 | | |
826 | 825 | | |
827 | | - | |
828 | | - | |
829 | | - | |
830 | | - | |
831 | | - | |
832 | | - | |
833 | | - | |
834 | | - | |
835 | | - | |
836 | | - | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
837 | 831 | | |
838 | 832 | | |
839 | 833 | | |
| |||
849 | 843 | | |
850 | 844 | | |
851 | 845 | | |
852 | | - | |
853 | | - | |
854 | | - | |
855 | | - | |
| 846 | + | |
856 | 847 | | |
857 | | - | |
| 848 | + | |
858 | 849 | | |
859 | 850 | | |
860 | 851 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
20 | 25 | | |
21 | 26 | | |
22 | 27 | | |
| |||
563 | 568 | | |
564 | 569 | | |
565 | 570 | | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
0 commit comments