-
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
Graceful stop #205
Merged
+68
−94
Merged
Graceful stop #205
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
00958a7
feat: use api/v0/shutdown to stop a deamon
richardschneider ec58831
feat: use api/v0/shutdown to stop a deamon
richardschneider 1db2ae4
test: work on windows
richardschneider 6ecc02a
test: timeout issues
richardschneider 252e1d5
fix: timeout
richardschneider c3315ac
test: run on windows
richardschneider 67a2041
chore: force a build
richardschneider 8cd5abe
chore: update dependency on ipfs
richardschneider b1dc8ee
feat: use api/v0/shutdown to stop a deamon
richardschneider 4f0c14d
test: work on windows
richardschneider 3b32c03
test: timeout issues
richardschneider 2aec828
feat: use api/v0/shutdown to stop a deamon
richardschneider 22c4ae9
test: work on windows
richardschneider 74f6dc8
fix: only use ipfs if its `ready`
dryajov a5d0ec5
fix: timeouts and conflicts
dryajov b3444f8
typo
dryajov 162ffb8
fix: return callback on error
dryajov 36fbb7a
fix: use this instead of self
dryajov 5fc58bb
fix: correctly initialize proc nodes
dryajov b1f5538
fix: no need for setImmediate
dryajov a61fa50
fix: simplify version call
dryajov 2d3cf40
fix: timeouts
dryajov 3ffcee3
fix: no need to init repo to get version
dryajov 4ad247b
fix: remove singleRun
dryajov 36aa183
chore: update deps
daviddias File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,3 +38,6 @@ dist | |
docs | ||
|
||
.idea | ||
|
||
.nyc_output | ||
.vscode |
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
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
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
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
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
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
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
Oops, something went wrong.
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.
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.
Why use a different pattern than the one used for ipfs-daemon (new Node + node.start)?
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.
I believe not doing that can end up in race conditions - take a look at maybeOpenRepo, its called by the IPFS constructor through
boot(self)
, but it is async, and the only way of knowing when it finished is by hooking into theready
event.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.
What I'm weird'ed out is that in
ipfsd-in-proc
, the IPFS instance starts (and therefore does network activity, lock repo, etc) on the constructor, while inipfsd-daemon
, the daemon only starts when .start is called. This asymmetry will lead to confusion and debugging issues in the future.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.
ah, I see - we're not actually starting the node since IPFS is constructed with both,
init
andstart
as false, take a look here - https://github.com/ipfs/js-ipfsd-ctl/blob/a61fa50d6834e61465398cd1d54e60ec913358eb/src/ipfsd-in-proc.js#L67...L74. This was done specifically to keep that symmetry with the other types of daemons, theready
event is there to make sure we don't trip over anything.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.
I see. Makes sense then. Thanks for clarifying :)