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

Restart filter on disconnects #128

Merged
merged 2 commits into from
Jul 8, 2022
Merged

Restart filter on disconnects #128

merged 2 commits into from
Jul 8, 2022

Conversation

neekolas
Copy link
Contributor

@neekolas neekolas commented Jul 7, 2022

Summary

  • Fixes an issue with js-libp2p where no events are emitted when connections close, because some streams are hanging open. This is borrowed from status web's implementation of js-waku. https://github.com/status-im/status-web/pull/288/files#
  • When a disconnect event is fired, attempts to recreate the filter stream in a loop. Currently only supports connecting to the same peer, which is fine in our case where we can reasonably expect that the same peer will eventually come back.

Notes

It's unclear whether this will actually catch our deploys, since the load balancer should be handling them in a 0-downtime way. Unless we are very lucky with the timing of the loop, I am not sure this event will trigger. It might, but I haven't been able to find a good way to test that locally, since it is dependent on the AWS LB behavior. If not, we will have to wait for the underlying connection monitoring issue in LibP2P to be fixed upstream before we have a solution to that case. But this will definitely help with any case of temporary downtime of our nodes.

neekolas added 2 commits July 6, 2022 17:13
Attempts to restart the filter in a loop until the node comes back online.
@cloudflare-workers-and-pages
Copy link

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: e15cfec
Status: ✅  Deploy successful!
Preview URL: https://bee475d1.xmtp-js.pages.dev
Branch Preview URL: https://reconnect-filter.xmtp-js.pages.dev

View logs

@neekolas neekolas marked this pull request as ready for review July 7, 2022 01:20
@neekolas neekolas requested a review from a team July 7, 2022 01:20
@neekolas neekolas merged commit 5281f3b into main Jul 8, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jul 8, 2022

🎉 This PR is included in version 4.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants