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

Add delay before reconnect to network service in IpfsDnsResolverImpl. #14510

Merged
merged 2 commits into from
Aug 15, 2022

Conversation

cypt4
Copy link
Collaborator

@cypt4 cypt4 commented Aug 7, 2022

Resolves brave/brave-browser#24461
This should lower CPU usage in case the network service fails to start.

Test Plan:

Check that IPFS DNS override works after kill network service process. (you can find it by "--utility-sub-type=network.mojom.NetworkService" flag):
Kill network service process, go to DNS settings, select something like Cloudflare option, load ipfs:// url, Check that IPFS daemon uses Cloudflare requests.

Resolves brave/brave-browser#24461
This should lower CPU usage in case the network service fails to start.
Copy link
Member

@yrliou yrliou left a comment

Choose a reason for hiding this comment

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

LGTM, just one missing header include, see comment below.

@@ -12,6 +12,8 @@

namespace ipfs {

constexpr base::TimeDelta kRetryDelay = base::Seconds(1);
Copy link
Member

Choose a reason for hiding this comment

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

add missing header include: #include "base/time/time.h"

@stephendonner
Copy link
Contributor

Verified PASSED using

Brave 1.44.62 Chromium: 104.0.5112.102 (Official Build) nightly (x86_64)
Revision 8e5396254975ef939f2ef7d0bd334e48a052b536-refs/branch-heads/5112@{#1478}
OS macOS Version 11.6.8 (Build 20G730)

Steps:

  1. installed 1.44.62
  2. launched Brave
  3. loaded brave://ipfs-internals
  4. clicked on Install and start
  5. opened Window -> Task Manager
  6. selected Utility: Network Service
  7. clicked on End Process
  8. opened brave://settings/security and made sure With Cloudflare (1.1.1.1) was selected
  9. loaded ipns://en.wikipedia-on-ipfs.org

Confirmed it loaded ipns://en.wikipedia-on-ipfs.org/wiki/ with a new Utility: Network Service process (Old: 6420, New: 6285)

example example example example example
Screen Shot 2022-08-23 at 9 52 45 AM Screen Shot 2022-08-23 at 9 59 53 AM Screen Shot 2022-08-23 at 10 08 34 AM Screen Shot 2022-08-23 at 10 07 30 AM Screen Shot 2022-08-23 at 10 14 38 AM

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

Successfully merging this pull request may close these issues.

DOH Ipfs override may cause high cpu usage
3 participants