Skip to content
This repository has been archived by the owner on Feb 26, 2021. It is now read-only.

Exception thrown crashes node if TCP connection gets reset #42

Open
fazo96 opened this issue Jan 18, 2018 · 6 comments
Open

Exception thrown crashes node if TCP connection gets reset #42

fazo96 opened this issue Jan 18, 2018 · 6 comments

Comments

@fazo96
Copy link

fazo96 commented Jan 18, 2018

Is this expected behavior? I'm asking because if I put a rendezvous server in the bootstrap nodes list and it fails to connect then the process crashes

@mkg20001
Copy link
Member

This is a feature, not a bug. (the listener returns an error when the server is unreachable)
Though I'm kind of unsure it it should be that way...

@fazo96
Copy link
Author

fazo96 commented Feb 12, 2018

I think it makes sense to throw an error if a bootstrap node is unreachable but the issue is that there is no easy way to catch it and avoid crashing the whole node.js process.

If I have multiple bootstrap nodes/signalling endpoints and one of them is unreachable I will still be able to operate correctly using other ways, but at the moment the error can't be caught and IPFS shuts itself down.

This means you can't add any websocket-star signalling endpoint if you think it might be unavailable at some point or you risk your application not working anymore for anyone

@mkg20001
Copy link
Member

I have written https://github.com/mkg20001/js-libp2p-websocket-star-multi for exactly this reason (currently needs to be updated with the new ws-star fixes)
@diasdavid Can I move that thing into the libp2p org?

@fazo96
Copy link
Author

fazo96 commented Feb 27, 2018

@mkg20001 Looks like this issue became relevant again

Screenshot: http://ipfs.io/ipfs/QmcZev5sELsTmojYMVucNrviUnv1qzBDLKpYkn7Qb2vpTn

The whole js-ipfs node does not work because the connection to one of the rendezvous servers using websocket-star crashes

@fazo96
Copy link
Author

fazo96 commented Apr 12, 2018

@mkg20001 any update on this? Do you think https://github.com/mkg20001/js-libp2p-websocket-star-multi is at least as stable as this module? I could try it instead of js-libp2p-websocket-star and see how it goes

@mkg20001
Copy link
Member

mkg20001 commented Apr 12, 2018

Yes, besides a few API differences it is just as stable as this one.
(Edit: ws-star-multi uses the ws-star client internally so it's basically like a try/catch wrapper)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants