Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lua/fiber: do not raise on printing a dead fiber #9099

Conversation

Gumix
Copy link
Contributor

@Gumix Gumix commented Sep 6, 2023

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

@Gumix Gumix requested review from a team as code owners September 6, 2023 16:47
@Gumix Gumix requested a review from locker September 6, 2023 17:02
src/lua/fiber.c Outdated Show resolved Hide resolved
src/lua/fiber.c Outdated Show resolved Hide resolved
test/app/fiber.result Outdated Show resolved Hide resolved
test/app/fiber.test.lua Outdated Show resolved Hide resolved
@locker locker assigned Gumix and unassigned locker Sep 7, 2023
@Gumix Gumix force-pushed the iverbin/gh-4265-printing-a-finished-fiber-stops-the-program branch from 793c9e4 to 715cb93 Compare September 7, 2023 12:11
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 tarantool#4265

NO_DOC=bugfix
@Gumix Gumix force-pushed the iverbin/gh-4265-printing-a-finished-fiber-stops-the-program branch from 715cb93 to 6a93581 Compare September 7, 2023 12:16
@Gumix Gumix requested a review from locker September 7, 2023 12:45
@Gumix Gumix assigned locker and unassigned Gumix Sep 7, 2023
@locker locker added the full-ci Enables all tests for a pull request label Sep 7, 2023
@locker locker merged commit 3421a3b into tarantool:master Sep 7, 2023
101 checks passed
@locker
Copy link
Member

locker commented Sep 7, 2023

Cherry-picked to 2.11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
full-ci Enables all tests for a pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Printing a finished fiber stops the program
4 participants