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?
If
engine.destroy()is called before the'ready'event forengine, thenrechokeIntervalIdis not set whenclearInterval()is called, resulting in thesetInterval()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 intorrent-streambut if a bug in the user's program, then it's a bug that exists intest/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 inindex.js, or a complete misunderstanding on my part?