lua/fiber: do not raise on printing a dead fiber
An attempt to print a dead fiber raised a fatal error, which is quite unexpected. This patch updates __tostring metamethod of fiber_object so that it pushes the "fiber: <fid> (dead)" string instead of the error. The __serialize metamethod is patched similarly. Closes #4265 NO_DOC=bugfix
Showing
- changelogs/unreleased/gh-4265-printing-a-finished-fiber-stops-the-program.md 3 additions, 0 deletions...ed/gh-4265-printing-a-finished-fiber-stops-the-program.md
- src/lua/fiber.c 28 additions, 12 deletionssrc/lua/fiber.c
- test/app-luatest/fiber_test.lua 36 additions, 0 deletionstest/app-luatest/fiber_test.lua
- test/app/fiber.result 1 addition, 2 deletionstest/app/fiber.result
- test/app/fiber.test.lua 1 addition, 1 deletiontest/app/fiber.test.lua
Loading
Please register or sign in to comment