Joinable fibers must be joined in order to prevent the fiber stack leak.
@xuniq is already working on this.
Since Oct 26, 2023.
- Dominant language
- CSS
- Stars
- 15
- Forks
- 49
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 3
Description
Related dev. issue(s): tarantool/tarantool#6455
Product: Tarantool
Since: 1.10.1 (since the fiber.join() had been introduced)
Audience/target: Tarantool users
Root document: https://www.tarantool.io/en/doc/latest/reference/reference_lua/fiber/#fiber-object-set-joinable
SME: @mkostoevr
Details
Now the document states the following:
Usually fiber_object:join() should be called, otherwise the fiber’s status may become ‘suspended’ when the fiber function ends, instead of ‘dead’.
It also should inform the user that some fiber resources will only be freed on the fiber join. On other words, setting a fiber joinable without actually joining it will lead to a memory leak (not big though, less than a kilobyte).
My proposal:
If a fiber is joinable, some of its resources aren't freed on the fiber death until it's joined, so calling fiber_object:join() on such a fiber is recommended. Also not joining a joinable fiber can switch its status to ‘suspended’ when the fiber function ends, instead of ‘dead’.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.