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

throw new Error('Not running'); // error message from dgram_legacy.js #601

Closed
leidegre opened this issue Feb 8, 2016 · 7 comments
Closed

throw new Error('Not running'); // error message from dgram_legacy.js #601

leidegre opened this issue Feb 8, 2016 · 7 comments
Labels

Comments

@leidegre
Copy link

@leidegre leidegre commented Feb 8, 2016

I don't got more atm but I'm getting this error soon after a torrent is removed, there's two in total, the other one is pending.

I have a working repo locally but it's not something I can reproduce elsewhere, the issue is probably external but there doesn't seem to be a way for me to handle the error, so the application crashes.

dgram.js:461
    throw new Error('Not running'); // error message from dgram_legacy.js

Error: Not running
    at Socket._healthCheck (dgram.js:461:11)
    at Socket.send (dgram.js:285:8)
    at RPC.send (C:\Projects\tordl\node_modules\k-rpc-socket\index.js:132:15)
    at RPC.query (C:\Projects\tordl\node_modules\k-rpc-socket\index.js:176:8)
    at RPC.query (C:\Projects\tordl\node_modules\k-rpc\index.js:142:17)
    at DHT._sendPing (C:\Projects\tordl\node_modules\bittorrent-dht\client.js:94:13)
    at DHT.addNode (C:\Projects\tordl\node_modules\bittorrent-dht\client.js:84:8)
    at Wire.<anonymous> (C:\Projects\tordl\node_modules\webtorrent\lib\torrent.js:582:23)
    at emitOne (events.js:90:13)
    at Wire.emit (events.js:182:7)
@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Feb 8, 2016

@leidegre Please share the following information:

  • What version of webtorrent are you using?
  • What version of node.js are you using?

cc @mafintosh

@leidegre

This comment has been minimized.

Copy link
Author

@leidegre leidegre commented Feb 9, 2016

@feross yeah, sorry. Latest 0.72.2 (first thing I did was to bump/update the version of webtorrent) unfortunately that did not fix it.

Latest node version, 5.5

If you want me to do some heavy lifting I'm more than happy to do so, it just that I haven't looked in to the source yet because I didn't have the time to investigate this further yesterday. Give me some pointers and I'll happily take a close look

From where I'm standing I looks like a socket that has hung up is still being used and that is causing an error somewhere which is probably fine it just the error handling that needs to detect this and handle it gracefully?

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Feb 10, 2016

Can you reliably trigger this error? If you can share code that triggers it reliably, it would really help to debug the issue.

Also, please try using webtorrent 0.74.0, since behavior might have changed.

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Feb 11, 2016

Attempted a naive fix and released as 0.74.1.

Going to assume this is fixed now. If you see it again, please leave a comment here and I will re-open this issue.

@feross feross closed this in 26e73b0 Feb 11, 2016
@leidegre

This comment has been minimized.

Copy link
Author

@leidegre leidegre commented Feb 11, 2016

@feross No dice but a different stack trace. This appears to be happening when the client is shutdown while a torrent is not cleaned up completely... I think.

My current working theory is that the way client.destroy works is prone to a race condition. Since the torrents and the dht is destroyed in parallel the dht may be destroyed before all torrents have been destroyed.

I've tried the following patch leidegre@fe8a856, it did not help a thing.

Possibly related https://github.com/feross/bittorrent-swarm/blob/master/index.js#L312 ?

0.74.1

dgram.js:461
    throw new Error('Not running'); // error message from dgram_legacy.js
    ^

Error: Not running
    at Socket._healthCheck (dgram.js:461:11)
    at Socket.address (dgram.js:371:8)
    at RPC.address (C:\Projects\tordl\node_modules\k-rpc-socket\index.js:119:22)
    at RPC.address (C:\Projects\tordl\node_modules\k-rpc\index.js:107:22)
    at DHT.address (C:\Projects\tordl\node_modules\bittorrent-dht\client.js:330:20)
    at Torrent._onWireWithMetadata (C:\Projects\tordl\node_modules\webtorrent\lib\torrent.js:724:31)
    at C:\Projects\tordl\node_modules\webtorrent\lib\torrent.js:650:12
    at doNTCallback0 (node.js:430:9)
    at process._tickCallback (node.js:359:13)

Another situation that appears to happen if the torrent is removed rather soon after it has been added.

C:\Projects\tordl\node_modules\webtorrent\lib\torrent.js:458
  if (self.destroyed) throw new Error('torrent is destroyed')
                      ^

Error: torrent is destroyed
    at Torrent.addPeer (C:\Projects\tordl\node_modules\webtorrent\lib\torrent.js:458:29)
    at emitOne (events.js:77:13)
    at Discovery.emit (events.js:169:7)
    at DHT.onPeer (C:\Projects\tordl\node_modules\torrent-discovery\index.js:66:10)
    at emitThree (events.js:97:13)
    at DHT.emit (events.js:175:7)
    at emit (C:\Projects\tordl\node_modules\bittorrent-dht\client.js:317:12)
    at onreply (C:\Projects\tordl\node_modules\bittorrent-dht\client.js:323:27)
    at onreply (C:\Projects\tordl\node_modules\bittorrent-dht\client.js:533:12)
    at Object.afterQuery [as callback] (C:\Projects\tordl\node_modules\k-rpc\index.js:272:18)
@feross feross reopened this Feb 14, 2016
@feross

This comment has been minimized.

Copy link
Member

@feross feross commented May 5, 2016

This was probably fixed a while ago. There were lots of fixes of this sort in bittorrent-dht a while ago.

@feross feross closed this May 5, 2016
@lock

This comment has been minimized.

Copy link

@lock lock bot commented May 4, 2018

This thread has been automatically locked because it has not had recent activity. To discuss futher, please open a new issue.

@lock lock bot locked as resolved and limited conversation to collaborators May 4, 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
2 participants
You can’t perform that action at this time.