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

Improve log warnings #2043

Closed
wants to merge 1 commit into from
Closed

Improve log warnings #2043

wants to merge 1 commit into from

Conversation

bachase
Copy link
Collaborator

@bachase bachase commented Mar 9, 2017

No description provided.

@@ -942,6 +942,8 @@ static bool saveValidatedLedger (
JLOG (j.warn())
<< "Transaction in ledger " << seq
<< " affects no accounts";
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess if you don't actually need a distinct log record for this JSON, you could just add it to the line above with a "\n" since they are at the same level. Looks fine to me either way.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

True. I've seen other JSON dumps go on their own line in some other spots of the log, but I'm not sure if that is universal.

Copy link
Contributor

@wilsonianb wilsonianb left a comment

Choose a reason for hiding this comment

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

👍 not sure why Travis keeps timing out

@bachase bachase added the Passed Passed code review & PR owner thinks it's ready to merge. Perf sign-off may still be required. label Mar 10, 2017
@bachase bachase changed the title Log non-account transaction in warning (RIPD-1440) Improve log warnings Mar 14, 2017
@bachase bachase removed the Passed Passed code review & PR owner thinks it's ready to merge. Perf sign-off may still be required. label Mar 14, 2017
@bachase
Copy link
Collaborator Author

bachase commented Mar 14, 2017

@wilsonianb @mellery451, I added another commit for a similarly simple increase in warning. Please take a quick peek when you get a chance.

@@ -442,7 +442,7 @@ PeerImp::fail(std::string const& reason)
shared_from_this(), reason));
if (socket_.is_open())
{
JLOG (journal_.debug()) << reason;
JLOG (journal_.warn()) << reason;
Copy link
Contributor

Choose a reason for hiding this comment

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

do you want to make the same change on L456, or is that not relevant?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes! 🤦‍♂️

@codecov-io
Copy link

codecov-io commented Mar 14, 2017

Codecov Report

Merging #2043 into develop will decrease coverage by <.01%.
The diff coverage is 50%.

@@            Coverage Diff             @@
##           develop   #2043      +/-   ##
==========================================
- Coverage     67.7%   67.7%   -0.01%     
==========================================
  Files          680     680              
  Lines        49219   49221       +2     
==========================================
+ Hits         33323   33324       +1     
- Misses       15896   15897       +1
Impacted Files Coverage Δ
src/ripple/overlay/impl/PeerImp.cpp 0% <0%> (ø) ⬆️
src/ripple/app/ledger/Ledger.cpp 81.42% <100%> (+0.05%) ⬆️
src/ripple/core/impl/JobQueue.cpp 86.11% <0%> (-0.47%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0df1b09...9e245a8. Read the comment docs.

Copy link
Contributor

@wilsonianb wilsonianb left a comment

Choose a reason for hiding this comment

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

I noticed this comment
https://github.com/ripple/rippled/blob/develop/src/ripple/overlay/impl/PeerImp.cpp#L170-L173
Do that should also apply in PeerImp::fail?

@@ -432,7 +432,6 @@ PeerImp::close()
}
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Is this deleted line intentional?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No.. double 🤦‍♂️

@bachase
Copy link
Collaborator Author

bachase commented Mar 15, 2017

I think warning is still appropriate for the fail case for both inbound and outbound connections since it represents abnormal termination. But I'm willing to be convinced otherwise.

Log non-account transaction in warning (RIPD-1440)
Log warning on PeerImp::fail (RIPD-1444)
@bachase bachase added the Passed Passed code review & PR owner thinks it's ready to merge. Perf sign-off may still be required. label Mar 20, 2017
@bachase
Copy link
Collaborator Author

bachase commented Mar 20, 2017

Rebased on 0.60.0 and squashed

Copy link
Contributor

@wilsonianb wilsonianb left a comment

Choose a reason for hiding this comment

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

👍

@scottschurr scottschurr mentioned this pull request Mar 21, 2017
@scottschurr
Copy link
Collaborator

Merged to develop as c981eb8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Passed Passed code review & PR owner thinks it's ready to merge. Perf sign-off may still be required.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants