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

Fixes mojo max size problem #4948

Merged
merged 1 commit into from
Mar 16, 2020
Merged

Fixes mojo max size problem #4948

merged 1 commit into from
Mar 16, 2020

Conversation

NejcZdovc
Copy link
Contributor

@NejcZdovc NejcZdovc commented Mar 16, 2020

Resolves brave/brave-browser#8691

Submitter Checklist:

Test Plan:

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

After-merge Checklist:

  • The associated issue milestone is set to the smallest version that the
    changes has landed on.
  • All relevant documentation has been updated.

@NejcZdovc NejcZdovc added feature/rewards CI/skip-android Do not run CI builds for Android CI/skip-linux CI/skip-ios Do not run CI builds for iOS labels Mar 16, 2020
@NejcZdovc NejcZdovc self-assigned this Mar 16, 2020
@bsclifton
Copy link
Member

As noted on Slack, I don't think this solution is correct

Ideal solution would be either:

  • building batch of records one at a time (storing how many bytes total so far), until max bytes reached
  • knowing maximum size of a publisher record and dividing the GetConfiguration().max_message_num_bytes number by this max size

@NejcZdovc
Copy link
Contributor Author

@bsclifton this one is just testing if this is a problem or not. It's not a final fix

@bsclifton
Copy link
Member

For sure 😄 Just left the note in case I was going to sleep before the conclusion

@bsclifton bsclifton self-requested a review March 16, 2020 07:25
Copy link
Member

@bsclifton bsclifton left a comment

Choose a reason for hiding this comment

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

Reviewed with @NejcZdovc - intention of this PR is to "stop the bleeding"

The limits here are much lower. We believe the Banner limit is what was causing a problem. We talked with teammates and determined that max publisher record size is 104 bytes (each) and max banner record size (each) is 1,543.

With limit set (before this PR) of 150,000... this results in 231,450,000 which is larger than the max size (GetConfiguration().max_message_num_bytes) which is 134,217,728. New size (max record count 80,000) is 123,440,000 (not counting the mojo message details)

There of course will be extra bytes since the messages themselves are encoded. This needs to be determined and accounted for

This PR puts us under the safe limits for both. Impact will be verified list takes longer to be realized- but it will stop the CPU problem and crashing problem (on Nightly and Beta)

When PR builder finishes, we can verify the binary that is created to ensure problem is gone 👍

@bsclifton
Copy link
Member

@bsclifton bsclifton added this to the 1.8.x - Nightly milestone Mar 16, 2020
@NejcZdovc
Copy link
Contributor Author

confirming that CPU is not a problem anymore after this fix

@NejcZdovc NejcZdovc changed the title Fixes CPU problem Fixes mojo max size problem Mar 16, 2020
@NejcZdovc NejcZdovc merged commit 8f26397 into master Mar 16, 2020
@NejcZdovc NejcZdovc deleted the cpu-problem branch March 16, 2020 08:50
bsclifton pushed a commit that referenced this pull request Mar 16, 2020
@bsclifton
Copy link
Member

Cherry-picked to 1.7 with 0ddb199

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/skip-android Do not run CI builds for Android CI/skip-ios Do not run CI builds for iOS feature/rewards
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bat Ledger Service uses 99% of CPU
2 participants