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

Storage sets too many event listeners on the same piece #127

Closed
feross opened this issue Sep 21, 2014 · 2 comments
Closed

Storage sets too many event listeners on the same piece #127

feross opened this issue Sep 21, 2014 · 2 comments

Comments

@feross
Copy link
Member

@feross feross commented Sep 21, 2014

Issue by vikstrous
Friday Jun 13, 2014 at 01:29 GMT
Originally opened as https://github.com/feross/bittorrent-client/issues/31


I'm not sure if this affects anything, but there's a warning about adding too many event listeners that comes up when the torrent has many small files in the same piece (11 small files in a row):

(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
    at Piece.addListener (events.js:160:15)
    at /home/v/dev/bittorrent-client/lib/storage.js:198:11
    at Array.forEach (native)
    at new File (/home/v/dev/bittorrent-client/lib/storage.js:196:15)
    at /home/v/dev/bittorrent-client/lib/storage.js:315:16
    at Array.map (native)
    at new Storage (/home/v/dev/bittorrent-client/lib/storage.js:307:36)
    at Torrent._onMetadataAndSwarm (/home/v/dev/bittorrent-client/lib/torrent.js:508:18)
    at Torrent._onMetadata (/home/v/dev/bittorrent-client/lib/torrent.js:496:10)
    at ut_metadata.<anonymous> (/home/v/dev/bittorrent-client/lib/torrent.js:340:12)
@feross

This comment has been minimized.

Copy link
Member Author

@feross feross commented Sep 21, 2014

Comment by feross
Wednesday Jul 02, 2014 at 22:33 GMT


This is a harmless warning and can be ignored. If we want to make it go away, we can call piece.setMaxListeners() with a large number or Infinity. But I'm inclined to leave it in for now to catch potential errors.

@feross

This comment has been minimized.

Copy link
Member Author

@feross feross commented Nov 19, 2014

Duplicate of #170 and fixed already in 0.12.1.

@feross feross closed this Nov 19, 2014
@lock lock bot locked as resolved and limited conversation to collaborators May 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.