fiber: set diagnostics at madvise/mprotect failure
Both madvise and mprotect calls can fail due to various reasons, mostly because of lack of free memory in the system. We log such cases via say_x helpers but this is not enough. In particular tarantool/memcached relies on diag error to be set to detect an error condition: | expire_fiber = fiber_new(name, memcached_expire_loop); | const box_error_t *err = box_error_last(); | if (err) { | say_error("Can't start the expire fiber"); | say_error("%s", box_error_message(err)); | return -1; | } Thus lets use diag_set() helper here and instead of macros use inline functions for better readability. Fixes #4722 Reported-by:Alexander Turenko <alexander.turenko@tarantool.org> Reviewed-by:
Alexander Turenko <alexander.turenko@tarantool.org> Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com>
Showing
- src/lib/core/errinj.h 2 additions, 0 deletionssrc/lib/core/errinj.h
- src/lib/core/fiber.c 67 additions, 17 deletionssrc/lib/core/fiber.c
- test/box/errinj.result 2 additions, 0 deletionstest/box/errinj.result
- test/unit/CMakeLists.txt 4 additions, 0 deletionstest/unit/CMakeLists.txt
- test/unit/fiber_stack.c 79 additions, 0 deletionstest/unit/fiber_stack.c
- test/unit/fiber_stack.result 8 additions, 0 deletionstest/unit/fiber_stack.result
- test/unit/suite.ini 1 addition, 1 deletiontest/unit/suite.ini
Loading
Please register or sign in to comment