-
Notifications
You must be signed in to change notification settings - Fork 62
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
fix: kill disposable nodes on stop and simplify started status #554
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If an `ipfsd-daemon` instance connects to a running API it does not have a `this.subprocess` property, yet if we try to stop the node it tries to access that property, leading to this sort of error: ``` 2) DelegatedPeerRouting "after all" hook in "DelegatedPeerRouting": TypeError: Cannot read property 'stderr' of null at Daemon.stop (node_modules/ipfsd-ctl/src/ipfsd-daemon.js:260:21) at processTicksAndRejections (node:internal/process/task_queues:93:5) at async Promise.all (index 0) ``` This PR moves `this.subprocess` access to where it is created and lets the process exiting set `this.started` to `false` as otherwise the state can get out of sync with reality.
achingbrain
changed the title
fix: kill disposable nodes immediately and
fix: kill disposable nodes immediately and let the subprocess exiting decide if we are running or not
Oct 22, 2020
jacobheun
approved these changes
Oct 23, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a nit, otherwise this LGTM
Co-authored-by: Jacob Heun <jacobheun@gmail.com>
achingbrain
changed the title
fix: kill disposable nodes immediately and let the subprocess exiting decide if we are running or not
fix: kill disposable nodes on stop and simplify started status
Oct 23, 2020
lidel
added a commit
to ipfs/ipfs-desktop
that referenced
this pull request
Jan 20, 2021
* Allow enabling pubsub setting via tray preferences * refactor: pubsub toggle triggers restart * chore: ipfsd-ctl v7.2.0 ipfsd.stop() did not wait for proper shutdown, which caused things to go racy during situations where we restart node. When unlucky, I ended up with two go-ipfs processses. Bumping version to include fix from ipfs/js-ipfsd-ctl#554 * fix: show pubsub status when starting * refactor: avoid duplicated pubsub in logs already logged in ./src/utils/create-toggler.js, so here we only log status when app starts and that is all * refactor: move pubsub to experiments it is still an experiment in go-ipfs: https://github.com/ipfs/go-ipfs/blob/master/docs/experimental-features.md#ipfs-pubsub * refactor: simplify pubsub enable/disable Co-authored-by: Marcin Rataj <lidel@lidel.org>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes two problems:
ipfs-daemon
to connect to a running node, there's nothis.subprocess
onlythis.api
so don't reference that property in thethis.stop()
method.this.stop()
Changes behaviour:
this.subprocess
setthis.started = false
instead of when we stop the processdisposable
, we don't really care about it exiting cleanly as we're going to delete it's repo shortly afterwards so justSIGKILL
it immediately.