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

Printing a finished fiber stops the program #4265

Closed
mtrempoltsev opened this issue Jun 2, 2019 · 6 comments · Fixed by #9099
Closed

Printing a finished fiber stops the program #4265

mtrempoltsev opened this issue Jun 2, 2019 · 6 comments · Fixed by #9099
Assignees
Labels
2.11 Target is 2.11 and all newer release/master branches bug Something isn't working

Comments

@mtrempoltsev
Copy link

Tarantool version:

1.10.3

Bug description:

local fiber = require('fiber')

local f = fiber.create(function() end)

print(f)
print('done')

Output:

the fiber is dead
@mtrempoltsev mtrempoltsev added the bug Something isn't working label Jun 2, 2019
@GeorgyKirichenko GeorgyKirichenko self-assigned this Jun 4, 2019
@kyukhin kyukhin added this to the 2.3.0 milestone Jun 4, 2019
@GeorgyKirichenko GeorgyKirichenko added the needs feedback Something is unclear with the issue label Jun 19, 2019
@GeorgyKirichenko
Copy link
Contributor

Please use fiber.status(f) or even f:status() before any fiber operation that could raise an error (including this example)

@kyukhin kyukhin modified the milestones: 2.3.1, 2.4.1 Dec 9, 2019
@kyukhin kyukhin modified the milestones: 2.4.1, 2.5.1 Jan 23, 2020
@kyukhin
Copy link
Contributor

kyukhin commented Apr 23, 2020

No feedback for minths, closing.

@kyukhin kyukhin closed this as completed Apr 23, 2020
@mtrempoltsev
Copy link
Author

What feedback are you waiting for? A simple print causes a fatal error, the reproducer I brought.

Tarantool 2.2

LuajitError: the fiber is dead
fatal error, exiting the event loop

@mtrempoltsev mtrempoltsev reopened this Apr 23, 2020
@kyukhin
Copy link
Contributor

kyukhin commented Apr 24, 2020

@GeorgyKirichenko provided you with clear workaround on how to work with fibers. I guess such thing as print(f) should be prohibited in docs.

@kyukhin kyukhin modified the milestones: 2.5.1, wishlist Apr 24, 2020
@kyukhin kyukhin removed the needs feedback Something is unclear with the issue label Apr 24, 2020
@mtrempoltsev
Copy link
Author

Do you really think that getting fiber status should cause a fatal error?

@Gerold103
Copy link
Collaborator

I would rather agree with Maks. Currently fiber object is too agressive about raising an error on literally anything when it is dead.

@kyukhin kyukhin removed this from the wishlist milestone Sep 20, 2022
@alyapunov alyapunov assigned alyapunov and Gumix and unassigned alyapunov Sep 6, 2023
@Gumix Gumix added the 2.11 Target is 2.11 and all newer release/master branches label Sep 6, 2023
Gumix added a commit to Gumix/tarantool that referenced this issue 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> is dead" string instead of the error.
The __serialize metamethod is patched similarly.

Closes tarantool#4265

NO_DOC=bugfix
Gumix added a commit to Gumix/tarantool that referenced this issue Sep 7, 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 tarantool#4265

NO_DOC=bugfix
Gumix added a commit to Gumix/tarantool that referenced this issue Sep 7, 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 tarantool#4265

NO_DOC=bugfix
locker pushed a commit that referenced this issue Sep 7, 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

NO_DOC=bugfix
locker pushed a commit that referenced this issue Sep 7, 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

NO_DOC=bugfix

(cherry picked from commit 3421a3b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.11 Target is 2.11 and all newer release/master branches bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants