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

The api is sometimes unresponsive when running in electron #230

Closed
Powersource opened this issue Apr 16, 2018 · 7 comments
Closed

The api is sometimes unresponsive when running in electron #230

Powersource opened this issue Apr 16, 2018 · 7 comments

Comments

@Powersource
Copy link

Powersource commented Apr 16, 2018

How to reproduce:

  1. Clone https://github.com/Powersource/ipfsd-ctl-no-start
  2. Make sure you're running a compatible node version.
  3. npm install
  4. node index.js id() should print every time.
  5. npm start (i.e. electron) and open the console. id() prints around 25%-50% of the time.

Been haunted by this bug or variations of it for quite some time.

@dryajov
Copy link
Member

dryajov commented Apr 16, 2018

I haven't been able to reproduce the issue. What os are you on?

@Powersource
Copy link
Author

Arch Linux

@Powersource
Copy link
Author

Anything I should try/any debug info that would be helpful? I'd be willing to help out with fixing this if I only knew where to begin :P

@dryajov
Copy link
Member

dryajov commented Apr 17, 2018

@Powersource that would be awesome, any help is always welcome!

  • Could you please verify that both your original implementation and your sample repo are using non-disposable repos (disposable: false).
  • Can you also run with debug enabled - DEBUG='ipfsd-ctl:*' npm run start, and attach the output of a failed run here? The debug output should show up in the console in your electron window.

@Powersource
Copy link
Author

About to go to bed but I can already say that I haven't tried with a non-disposable repo for quite a while. Both the app and the linked example are set to disposable.

@Powersource
Copy link
Author

Tried to replicate on my laptop (arch too, disposable nodes for now). I didn't manage to break it completely, but the 50% chance of it working correctly is still there. When it didn't work instantly it instead, very consistently, took very close to 1 minute (just below) to print id():

Running Node
10:43:23.953 /home/me/prj/web/ipfsd-ctl-no-start/node_modules/debug/src/browser.js:133 ipfsd-ctl:exec ipfs +0ms init
10:43:24.538 /home/me/prj/web/ipfsd-ctl-no-start/node_modules/debug/src/browser.js:133 ipfsd-ctl:exec ipfs +585ms config show
10:43:24.684 /home/me/prj/web/ipfsd-ctl-no-start/node_modules/debug/src/browser.js:133 ipfsd-ctl:exec ipfs +146ms config replace /tmp/87ff41146ad4e55bcddc3134019bc49e
10:43:24.822 /home/me/prj/web/ipfsd-ctl-no-start/node_modules/debug/src/browser.js:133 ipfsd-ctl:daemon Unable to open api file: Error: ENOENT: no such file or directory, open '/tmp/ipfs_e9d7a7a33df60a1044bc7bfec993522b/api' +0ms
10:43:24.822 /home/me/prj/web/ipfsd-ctl-no-start/node_modules/debug/src/browser.js:133 ipfsd-ctl:exec ipfs +138ms daemon
10:43:25.329 /home/me/prj/web/ipfsd-ctl-no-start/node_modules/secp256k1/index.js:6 Secp256k1 bindings are not compiled. Pure JS implementation will be used.
(anonymous) @ /home/me/prj/web/ipfsd-ctl-no-start/node_modules/secp256k1/index.js:6
10:43:25.469 /home/me/prj/web/ipfsd-ctl-no-start/index.js:8 Spawned ipfs
10:44:24.985 /home/me/prj/web/ipfsd-ctl-no-start/index.js:13 Object {id: "QmXAGUg7en5W2fymwdhvdG5dc1pYVHo4s4P4DwLp1fww4W", publicKey: "CAASpgIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQ…X9JshuK+3qAZjIL5D9HDWniP1/JfRsDXMf3aclcx/AgMBAAE=", addresses: Array(1), agentVersion: "go-ipfs/0.4.14/", protocolVersion: "ipfs/0.1.0"}addresses: Array(1)0: "/ip4/127.0.0.1/tcp/43007/ipfs/QmXAGUg7en5W2fymwdhvdG5dc1pYVHo4s4P4DwLp1fww4W"length: 1__proto__: Array(0)agentVersion: "go-ipfs/0.4.14/"id: "QmXAGUg7en5W2fymwdhvdG5dc1pYVHo4s4P4DwLp1fww4W"protocolVersion: "ipfs/0.1.0"publicKey: "CAASpgIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDK/RGKSSc8BDI5NACLpY33K8ixEuJFeTLzDkvj0BxAe5qB/deObeHXfaRV8Vl+W50gcv9a+cnCi8gPcIBpGjYVIfAvedzIYCHjRENN7D57VMacEmzLESRp3Dr5qji/4TD1D/OJfmMLewuWnZWZgyswcq9iwUKCcplY+P8yZjHJZSyfOCumVDMBCQ6Zf4+qhqUbxGttkNfYiwrw5fLPJvoN4eICfpe2jxf1q3jHNuUv/eQfP2D6d2jLDK/QOXx4TkVpT9kmE/4cHpqLnBAsO3wB9f45st4+KtCJZbu3grUBwQmX9JshuK+3qAZjIL5D9HDWniP1/JfRsDXMf3aclcx/AgMBAAE="__proto__: Object
10:44:24.988 /home/me/prj/web/ipfsd-ctl-no-start/node_modules/debug/src/browser.js:133 ipfsd-ctl:daemon kill via api +1m 21501
10:44:25.000 /home/me/prj/web/ipfsd-ctl-no-start/node_modules/debug/src/browser.js:133 ipfsd-ctl:daemon killed +12ms 21501

I'll try a non-disposable setup later.

@Powersource
Copy link
Author

I tried with a non-disposable node iirc but that didn't help.

However, I just now upgraded from electron 1.8.4 to electron 2.0.2 and it works great now! Most of the time instantly, sometimes takes a few seconds but probably not more than 10 at most. So happy this is fixed, I was going crazy 😂 🎉 🎉 🎉

There are a lot of bug fixes in the electron 2 announcement, not sure which one would have helped. There are 2 mentioning custom protocols but that seems to have been backported to 1.8.4. There's one about graceful shutdown on linux, might have been that one if the laptop in your profile pic @dryajov is a mac :P

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

No branches or pull requests

2 participants