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

fix(log): Limit RPC failure log length, add details to RPC failure logs #6754

Merged
merged 3 commits into from
May 25, 2023

Conversation

teor2345
Copy link
Contributor

@teor2345 teor2345 commented May 24, 2023

Motivation

Zebra will log all the data sent by an RPC on failure, including up to 2MB of block or transaction data.

I also improved some specific RPC failure and RPC test logs as part of this PR.

Solution

  • Log up to 100 characters of RPC data when an RPC fails
  • When a submitblock RPC fails, log the specific kind of failure, and log the block hash

Related fixes:

  • Add detailed logs to some RPC tests, to help diagnose test failures

Review

This is a low priority usability fix, it also reduces log size on disk.

Reviewer Checklist

  • Will the PR name make sense to users?
    • Does it need extra CHANGELOG info? (new features, breaking changes, large changes)
  • Are the PR labels correct?
  • Does the code do what the ticket and PR says?
    • Does it change concurrent code, unsafe code, or consensus rules?
  • How do you know it works? Does it have tests?

@teor2345 teor2345 added C-bug Category: This is a bug P-Low ❄️ I-heavy Problems with excessive memory, disk, or CPU usage I-usability Zebra is hard to understand or use A-diagnostics Area: Diagnosing issues or monitoring performance labels May 24, 2023
@teor2345 teor2345 self-assigned this May 24, 2023
@teor2345 teor2345 requested a review from a team as a code owner May 24, 2023 02:30
@teor2345 teor2345 requested review from upbqdn and removed request for a team May 24, 2023 02:30
@github-actions github-actions bot added the C-feature Category: New features label May 24, 2023
@teor2345 teor2345 changed the title fix(log): Limit RPC failure log length, add RPC test diagnostics fix(log): Limit RPC failure log length, add details to RPC failure logs May 24, 2023
@codecov
Copy link

codecov bot commented May 24, 2023

Codecov Report

Merging #6754 (b604aa6) into main (3706ff6) will increase coverage by 0.02%.
The diff coverage is 0.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6754      +/-   ##
==========================================
+ Coverage   78.11%   78.14%   +0.02%     
==========================================
  Files         308      308              
  Lines       40877    40887      +10     
==========================================
+ Hits        31931    31951      +20     
+ Misses       8946     8936      -10     

mergify bot added a commit that referenced this pull request May 25, 2023
@mergify mergify bot merged commit f9b5eb3 into main May 25, 2023
@mergify mergify bot deleted the rpc-test-diagnostics branch May 25, 2023 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Diagnosing issues or monitoring performance C-bug Category: This is a bug C-feature Category: New features I-heavy Problems with excessive memory, disk, or CPU usage I-usability Zebra is hard to understand or use
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants