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

Exception thrown in Torrent._debug after torrent has been destroyed. #1800

Closed
jsdt opened this issue Jan 2, 2020 · 1 comment
Closed

Exception thrown in Torrent._debug after torrent has been destroyed. #1800

jsdt opened this issue Jan 2, 2020 · 1 comment

Comments

@jsdt
Copy link
Contributor

@jsdt jsdt commented Jan 2, 2020

What version of this package are you using?

0.107.17

What operating system, Node.js, and npm version?

I'm using Node 10 in App Engine.

What happened?

I've seen some exceptions in the logs which appear to come from calling _debug on a torrent that has already been destroyed. The stack trace is posted below.

TypeError: Cannot read property '_debugId' of null
    at Torrent._debug (/srv/node_modules/webtorrent/lib/torrent.js:1633:31)
    at utPex.wire.ut_pex.on.peer (/srv/node_modules/webtorrent/lib/torrent.js:982:14)
    at utPex.emit (events.js:198:13)
    at compact2string.multi.forEach.peer (/srv/node_modules/ut_pex/index.js:107:18)
    at Array.forEach (<anonymous>)
    at utPex.onMessage (/srv/node_modules/ut_pex/index.js:103:45)
    at Wire._onExtended (/srv/node_modules/bittorrent-protocol/index.js:554:26)
    at Wire._onMessage (/srv/node_modules/bittorrent-protocol/index.js:686:21)
    at Wire._write (/srv/node_modules/bittorrent-protocol/index.js:590:12)
    at doWrite (/srv/node_modules/readable-stream/lib/_stream_writable.js:405:139)
    at writeOrBuffer (/srv/node_modules/readable-stream/lib/_stream_writable.js:394:5)
    at Wire.Writable.write (/srv/node_modules/readable-stream/lib/_stream_writable.js:303:11)
    at Socket.ondata (_stream_readable.js:709:20)
    at Socket.emit (events.js:198:13)
    at addChunk (_stream_readable.js:288:12)
    at readableAddChunk (_stream_readable.js:269:11)
    at Socket.Readable.push (_stream_readable.js:224:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:94:17)

What did you expect to happen?

I didn't expect an exception.

Are you willing to submit a pull request to fix this bug?

Sure. I can submit a fix that skips logging if the client has already been wiped out, but I wanted to check if some other change would make more sense.

@jsdt

This comment has been minimized.

Copy link
Contributor Author

@jsdt jsdt commented Jan 6, 2020

This was fixed in #1801

@jsdt jsdt closed this Jan 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.