Skip to content

Joinable fibers must be joined in order to prevent the fiber stack leak. #3790

Open
@mkostoevr

Description

@mkostoevr

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’.

Metadata

Metadata

Assignees

Labels

add details[nature] More details needed, some info missing. Documentation is incomplete.fiberreference[location] Tarantool manual, Reference partserver[area] Task relates to Tarantool's server (core) functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions