-
Notifications
You must be signed in to change notification settings - Fork 1.2k
ipfs.stop leaves process hanging #1168
Comments
I think I've seen this a couple of times in the test, as aegir refuses to completely exit after finishing running all the tests. |
Code for reproducing (should be testing with lots of different configs though, as the kad-dht issue doesn't show up with default config): const wtfnode = require('wtfnode')
const ipfs = require('./src/core')
const node = new ipfs()
node.on('ready', () => {
console.log('node ready, stopping in five seconds')
setTimeout(node.stop, 5000)
})
node.on('stop', () => {
console.log('node stopped')
setTimeout(wtfnode.dump, 1000)
}) |
@victorbjelkholm try using |
@diasdavid hm, seemed to work fine after fixing libp2p/js-libp2p-mdns#63, the event listener doesn't show up and the process exists successfully.
|
Is there something I can test out to help? |
Script to reproduce: const wtf = require('wtfnode')
const IPFS = require('ipfs')
console.log('IPFS node starting')
const node = new IPFS({
EXPERIMENTAL: {
dht: true
}
})
node.once('ready', () => {
console.log('IPFS node ready')
node.stop(() => {
console.log('IPFS node stopped')
setTimeout(() => wtf.dump(), 5000)
})
})
/*
OUTPUT:
IPFS node starting
Swarm listening on /ip4/127.0.0.1/tcp/49645/ipfs/QmU8eJXWVYudzSrV5fxQuptmK1haqMG6E1eKP47xuF4e1K
IPFS node ready
IPFS node stopped
[WTF Node?] open handles:
- File descriptors: (note: stdio always exists)
- fd 1 (tty) (stdio)
- fd 2 (tty) (stdio)
- Intervals:
- (3600000 ~ 60 min) (anonymous) @ /Users/alan/Desktop/test/node_modules/libp2p-kad-dht/src/providers.js:203
*/ |
having the same issue here. |
@alanshaw I believe you have to call |
@dryajov Should not have to call |
yeah, calling exit is not a good solution. |
good point @richardschneider @sagivo |
@diasdavid Need to release |
Did a search of all |
@richardschneider released libp2p-mdns as patch release. You should get it on your next fresh npm install |
Fixes the issue for me also, thanks @richardschneider |
yep, looking good |
I'm seeing ipfs.stop() never calling its callback. I notice the examples above use event listeners, but the API defines it as having a callback . Should that be a new issue, or does it look like this one needs reopening ? |
New issue please @mitra42 😄 - please could you provide reproducable example code? Its the stop even emitted but not the callback called? |
Ok detailed new issue at #1806 |
License: MIT Signed-off-by: Alan Shaw <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
Type:
Bug
Severity:
High
Description:
ipfs.stop(cb)
callscb
but does not completely stop the node.wtfnode
says that the following interval is still active:Note
libp2p-kad-dht/src/providers.js:203
sets up a function to "cleanup" every hour, but this cannot be canceled.Steps to reproduce the error:
Create a new js-ipfs instance and call
stop
, your Node.js process will not exit.The text was updated successfully, but these errors were encountered: