Skip to content

Race condition can result in torrent-stream preventing process exit #198

Closed
@Trott

Description

@Trott

If engine.destroy() is called before the 'ready' event for engine, then rechokeIntervalId is not set when clearInterval() is called, resulting in the setInterval() running endlessly and the app never exiting. It's not clear to me if this should be considered a bug in the user's program or a bug in torrent-stream but if a bug in the user's program, then it's a bug that exists in test/tracker.js. Run the test multiple times to make it hang, and more recent versions of Node.js seem to be more susceptible to the problem.

Refs:
nodejs/node#29504 (comment)

Is this a bug in the test/tracker.js, a bug in index.js, or a complete misunderstanding on my part?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions