This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
ipfs.stop(cb) not calling cb, looks like in libp2p.stop in [discovery].map.stop #1806
Labels
exp/expert
Having worked on the specific codebase is important
kind/bug
A bug in existing code (including security flaws)
P1
High: Likely tackled by core team if no one steps up
Type: Bug
Severity: High ? The API is not working as described, (no significant impact on me)
Description:
I recently added node.stop((err, res) => debug("IPFS ended")) to my system because I was seeing that my crawl script (for archive.org) was not exiting correctly if IPFS was connected.
While this appeared to stop IPFS (the script now exits), the debug line is never called.
Using breakpoints in the IDE the problem appears to be in
ipfs/source/core/components/stop.js
which gets the callback fromself._mfsPreload.stop
but not fromself.libp2p.stop(cb)
. Digging deeper, in/Users/mitra/git/dweb-mirror/node_modules/libp2p/src/index.js
instop()
which never completes the first step in the series, i.e. the
if (this._floodSub)
is never called. I don't know libp2p well enough to dig deeper into the parallel code atTo see why the cb is not called back
I suspect, from the history of similar issues in #1168 that its config dependent, Note my config includes wss and is:
Steps to reproduce the error:
I am seeing this in a fairly complex piece of code, which I will try and strip down to its basics but to repeat it ...
At the end it outputs
HTTP is stopped
and should, but doesnt outputIPFS is stopped
.I will attempt to reduce to something simpler, but I suspect that whatever causes IPFS not to exit correctly is may mean that once it is reduced that the problem goes away.
The text was updated successfully, but these errors were encountered: