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

Throttle IPFS_INIT_FAILED events #1831

Closed
2 tasks
lidel opened this issue Jul 30, 2021 · 3 comments · Fixed by #2133
Closed
2 tasks

Throttle IPFS_INIT_FAILED events #1831

lidel opened this issue Jul 30, 2021 · 3 comments · Fixed by #2133
Assignees
Labels
effort/hours Estimated to take one or several hours exp/novice Someone with a little familiarity can pick up kind/bug A bug in existing code (including security flaws) P2 Medium: Good to have, but can wait until someone steps up released

Comments

@lidel
Copy link
Member

lidel commented Jul 30, 2021

Problem

When user opts-in to sending usage metrics, and ipfs-webui is not able to connect to HTTP API, it will send a new IPFS_INIT_FAILED event to Countly every few seconds when it tries to reconnect and fails again. This produces multiple events sent every minute:

2021-07-31--00-56-47

This behavior can be observed on https://webui.ipfs.io and inside of ipfs-desktop when a local node is shut down when webui is still open (need to opt-in to metrics first)

Additionally, on a slower machine ipfs-desktop shows ipfs-webui before go-ipfs is fully booted, but that triggers no more than one or two events.

Solution

We should be throttling how often IPFS_INIT_FAILED is sent.

Some quick ideas:

  • We want to decrease noise of situations where node started within a few seconds (either automatically in ipfs-desktop or manually when user forgot to run it)
    • Idea: do not send send it immediately, but keep buffering events and wait for IPFS_INIT_FAILED state to remain for 10+ seconds.
  • When IPFS_INIT_FAILED is confirmed by being real for over 10 seconds, we do not want to keep spamming events every few seconds.
    • Idea: send it only once every 5 minutes (memoize send function for 5min)

Tasks

Preview Give feedback
@lidel lidel added kind/bug A bug in existing code (including security flaws) exp/novice Someone with a little familiarity can pick up P2 Medium: Good to have, but can wait until someone steps up effort/hours Estimated to take one or several hours labels Jul 30, 2021
@SgtPooki SgtPooki moved this to To do in IPFS-GUI (PL EngRes) Jul 19, 2022
@SgtPooki SgtPooki moved this from Needs Grooming to Prioritized / Ready for Dev in IPFS-GUI (PL EngRes) Nov 29, 2022
@SgtPooki
Copy link
Member

💯 We should separate the IPFS_INIT_FAILED metric from retry failures.

When I first saw the IPFS_INIT_FAILED metric, I thought it was supposed to only fire once for each user, for each app instance run, and I think that intuition should be codified. Retries continuing to fail are valid, but should be captured via a different metric.

@SgtPooki
Copy link
Member

@SgtPooki SgtPooki self-assigned this Jun 29, 2023
@SgtPooki SgtPooki moved this from Prioritized / Ready for Dev to In Progress in IPFS-GUI (PL EngRes) Jun 29, 2023
@SgtPooki SgtPooki linked a pull request Jun 30, 2023 that will close this issue
@github-project-automation github-project-automation bot moved this from In Progress to Done in IPFS-GUI (PL EngRes) Jul 1, 2023
@ipfs-gui-bot
Copy link
Collaborator

🎉 This issue has been resolved in version 4.0.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/hours Estimated to take one or several hours exp/novice Someone with a little familiarity can pick up kind/bug A bug in existing code (including security flaws) P2 Medium: Good to have, but can wait until someone steps up released
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants