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

feat: better stream handling #140

Merged
merged 10 commits into from
Dec 23, 2016
Merged

feat: better stream handling #140

merged 10 commits into from
Dec 23, 2016

Conversation

dignifiedquire
Copy link
Member

@dignifiedquire dignifiedquire commented Dec 20, 2016

  • upgrade aegir
  • upgrade dependencies
  • handle stream errors when setting the config
  • use pump instead of pipe

I've also pulled in the changes from subcomandante to execa from #89

- upgrade aegir
- upgrade dependencies
- handle stream errors when setting the config
- use pump instead of pipe
"mkdirp": "^0.5.1",
"multihashes": "^0.3.1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is multihashes needed somewhere else? I don't see it being used in the tests.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@haadcode
Copy link
Member

One comment and once CI is happy, LGTM.

"go-ipfs-dep": "0.4.4",
"ipfs-api": "^12.0.3",
"multiaddr": "^2.1.0",
"once": "^1.4.0",
"rimraf": "^2.5.4",
"run-series": "^1.1.4",
"shutdown": "^0.2.4",
"subcomandante": "^1.0.5"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jbenet invested a lot of time making sure we had a thing that would not leave zombie IPFS processes in user machines. It was what blocked #89 all this time.

Until we have comprehensive tests to make sure that you can spawn a bunch of daemons and make sure they don't become zombies, we can't move to execa. Historically, a way to test this was with station

If I understand correctly, migrating to execa is not a requirement for any particular feature.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As for the tests: #95

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see how the burden of proof lies on the one changing it, as I haven't seen any proof subcomandante being as good as you say it is. There are tests for the cleanup behavior inside execa, which I wrote when implementing. I also did manual tests with execa inside reusing the testsuite from subcomandante so those cases all work.

So far all I heard was 'there were extensive tests' but I haven't seen or read what those actually were, so please tell which scenarios you are concerned about and I can add tests for them

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@diasdavid I've ported the test suite from node-subcomandante, to run against the new src/exec.js to add a baseline of coverage to this module.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Soo even though those tests pass fine, it seems thing are wonky right now. I have 5 ipfs instances running after a single npm test run :(

I will revert the switch to execa tomorrow.

disposable: true,
init: true
}

function tempDir () {
return join(os.tmpdir(), `ipfs_${String(Math.random()).substr(2)}`)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the path to tmpDir available through some call?

@@ -64,25 +83,20 @@ module.exports = class Node {
this.initialized = fs.existsSync(path)
this.clean = true
this.env = Object.assign({}, process.env, {IPFS_PATH: path})
this.disposable = disposable

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add to the list of props path as the path used for the repo

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure, I didn't change anything from that logic

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this comment was meant for the one above

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add to the list of props path as the path used for the repo

already there if you look at the full file

if (err) throw err
done()
})
shutdown (callback) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still a bad name, check the deleted comment

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but independent of the name, it should be document of what it is doing

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree I think it's actuallly a pretty fitting name, in terms of docs nothing changed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no docs (am I missing something?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a comment above which kinda describes what it does, no other docs currently, correct

@dignifiedquire
Copy link
Member Author

Added documentation https://ipfs.github.io/js-ipfsd-ctl/

@dignifiedquire
Copy link
Member Author

Looks like I can't run the last test on travis:

    ✓ SIGTERM kills hang (412ms)
trap: SIGHUP: bad trap
    1) SIGKILL kills survivor

@dignifiedquire
Copy link
Member Author

@diasdavid this should be ready now, we are back to subcomandante and have more tests and docs

@daviddias daviddias merged commit a0adc82 into master Dec 23, 2016
@daviddias daviddias deleted the upgrade-aegir branch December 23, 2016 07:04
@daviddias daviddias removed the status/in-progress In progress label Dec 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants