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

Fix non disposable daemon init/start and attach to running daemons #308

Closed
wants to merge 11 commits into from

Conversation

hugomrdias
Copy link
Member

This PR reworks daemon spawn options and handling of start/init, it also makes sure spawned daemons attach themselves to running daemons on the default/provided repo.

Ref: #304

Fixes #305
Fixes #276

@ghost ghost assigned hugomrdias Oct 29, 2018
@ghost ghost added the status/in-progress In progress label Oct 29, 2018
@daviddias daviddias changed the base branch from master to non-disposable-example October 29, 2018 12:00
Copy link
Member

@daviddias daviddias left a comment

Choose a reason for hiding this comment

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

@hugomrdias I've changed the target of this branch to PR against my branch. Let's merge both and then merge to master.

@hugomrdias
Copy link
Member Author

@diasdavid this was already rebased with master I would prefer to keep both PR separate. But if you want to merge them, we should rebase yours with master, merge this one with yours, make sure the example work and then merge it back to this one with fast-foward.

@daviddias daviddias force-pushed the non-disposable-example branch from d3640ee to db6375f Compare October 29, 2018 12:46
@daviddias
Copy link
Member

#304 has now master rebased onto it.

@daviddias daviddias changed the base branch from non-disposable-example to master October 31, 2018 07:45
@ghost ghost assigned daviddias Oct 31, 2018
@daviddias
Copy link
Member

Fails a bunch of tests on the browser with the same error:

  1) non-disposable go daemon
       should attach to initialized and running node:
     Error: Error: Request has been terminated
Possible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.
    at request.post.send.end (webpack://ipfsdctl/src/factory-client.js:100 <- node_modules/aegir/src/config/karma-entry.js:344964:27)
    at Request.IpfsdCtl../node_modules/superagent/lib/client.js.Request.callback (webpack://ipfsdctl/node_modules/superagent/lib/client.js:611 <- node_modules/aegir/src/config/karma-entry.js:302263:3)
    at Request.IpfsdCtl../node_modules/superagent/lib/client.js.Request.crossDomainError (webpack://ipfsdctl/node_modules/superagent/lib/client.js:628 <- node_modules/aegir/src/config/karma-entry.js:302280:8)
    at XMLHttpRequest.xhr.onreadystatechange (webpack://ipfsdctl/node_modules/superagent/lib/client.js:703 <- node_modules/aegir/src/config/karma-entry.js:302355:19)

Tests failing are:

  non-disposable go daemon
    ✓ should fail when passing initOptions to a initialized repo (3ms)
    1) should attach to initialized and running node
    2) should attach to running node with manual start
    3) should not init and start
    4) should init and start
    5) should only init
    6) should only init manualy

  non-disposable js daemon
    ✓ should fail when passing initOptions to a initialized repo (2ms)
    7) should attach to initialized and running node
    8) should attach to running node with manual start
    9) should not init and start
    10) should init and start
    11) should only init
    12) should only init manualy

Copy link
Member

@daviddias daviddias left a comment

Choose a reason for hiding this comment

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

needs all tests to pass

@hugomrdias wanna make the tests work on the browser as well?

@daviddias daviddias added P1 High: Likely tackled by core team if no one steps up exp/expert Having worked on the specific codebase is important labels Nov 5, 2018
@hugomrdias
Copy link
Member Author

it works now 🔥 🔥
sorry for the big PR but the behaviour between the 3 impls was very different, on the bright side all 3 impls support non-disposable and auto attaching in node and browser.

Pls review again.

@hugomrdias
Copy link
Member Author

CI only has a commitlint error squash will fix that and 2 Windows random errors.

@@ -23,7 +20,7 @@ class FactoryDaemon {
if (options && options.type === 'proc') {
throw new Error('This Factory does not know how to spawn in proc nodes')
}
this.options = Object.assign({}, { type: 'go' }, options)
this.options = Object.assign({ type: 'go' }, options)
Copy link
Member

Choose a reason for hiding this comment

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

Minor nit: we've required merge-options above, why not use it here instead of Object.assign?

Copy link
Member

@achingbrain achingbrain left a comment

Choose a reason for hiding this comment

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

Attaching to running daemons is a great feature, LGTM.

@daviddias
Copy link
Member

@hugomrdias what's missing for this PR to land?

@daviddias daviddias removed their assignment Jan 27, 2019
@hugomrdias hugomrdias closed this Sep 18, 2019
@hugomrdias hugomrdias deleted the fix/non-disposable branch September 18, 2019 13:07
@daviddias
Copy link
Member

@hugomrdias not necessary anymore?

@hugomrdias
Copy link
Member Author

no 0.47.0 has all this and more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/expert Having worked on the specific codebase is important P1 High: Likely tackled by core team if no one steps up status/in-progress In progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

spawn non-disposable with init: true start: true doesn't work TypeError: Cannot read property 'id' of null
4 participants