ProcessMessage
net: Avoid redundant and confusing FAILED log #19293
pull MarcoFalke wants to merge 2 commits into bitcoin:master from MarcoFalke:2006-netNoRet changing 2 files +112 −96-
MarcoFalke commented at 10:59 am on June 16, 2020: memberRemove a redundant and confusing “FAILED” log message and gets rid of the unused return type in
-
net: Avoid redundant and confusing FAILED log
Every `return false` is preceeded by a detailed debug log message to explain that a disconnect or misbehavior happened. Logging another generic "FAILED" message seems redundant. Also, the size of the message and the message type has already been logged and is thus redundant as well. Finally, claiming that message processing FAILED seems odd, because the message was fully processed to the point where it was concluded that the peer should be either disconnected or marked as misbehaving.
-
net: Remove dead logging code
fRet is never false, so the dead code can be removed and the return type can be made void
-
MarcoFalke added the label Utils/log/libs on Jun 16, 2020
-
MarcoFalke commented at 11:19 am on June 16, 2020: memberThe refactor commit to remove dead code can be reviewed with
--word-diff-regex=. -U0
-
practicalswift commented at 2:44 pm on June 16, 2020: contributorConcept ACK: higher signal to noise in our logging is welcome
-
troygiorshev commented at 5:50 pm on June 16, 2020: contributor
ACK fa1904e5f0d164fbcf41398f9ebbaafe82c28419
Reviewed, ran tests, checked that no tests relied on the removed log message.
-
glozow commented at 9:49 pm on June 16, 2020: memberutACK https://github.com/bitcoin/bitcoin/commit/fa1904e5f0d164fbcf41398f9ebbaafe82c28419 Everywhere that fails will log from
Misbehaving
or right before returning anyway. -
DrahtBot commented at 9:55 pm on June 16, 2020: member
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #19306 (refactor: Replace RecursiveMutex with Mutex in CTxMemPool by hebasto)
- #19272 (net, test: invalid p2p messages and test framework improvements by jonatack)
- #19204 (p2p: Reduce inv traffic during IBD by MarcoFalke)
- #19174 (refactor: replace CConnman/BanMan pointers by references in net_processing.cpp by theStack)
- #19107 (p2p: Refactor, move all header verification into the network layer, without changing behavior by troygiorshev)
- #18638 (net: Use mockable time for ping/pong, add tests by MarcoFalke)
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
-
fanquake requested review from jnewbery on Jun 17, 2020
-
hebasto commented at 11:38 am on June 17, 2020: memberConcept ACK.
-
jnewbery commented at 3:04 pm on June 17, 2020: member
utACK fa1904e5f0d164fbcf41398f9ebbaafe82c28419
The “return false to log” pattern is inconsistently applied, so we should just make it
ProcessMessage
’s responsibility to log in all cases.There are just a couple of places where this could make logging a little less clear: those where no log string is passed to the
Misbehaving()
call and we were previously returning false to log the message type and size. No need to fix that in this PR. Perhaps a future PR could remove the defaultmessage
parameter fromMisbehaving()
and make sure that all calls include a helpful log message. -
fanquake requested review from naumenkogs on Jun 19, 2020
-
naumenkogs commented at 8:31 am on June 19, 2020: memberutACK fa1904e
-
fanquake merged this on Jun 19, 2020
-
fanquake closed this on Jun 19, 2020
-
fanquake commented at 9:19 am on June 19, 2020: member@amitiuttarwar you may also have been interested here.
-
MarcoFalke deleted the branch on Jun 19, 2020
-
sidhujag referenced this in commit ce1acf0098 on Jul 7, 2020
-
Fabcien referenced this in commit 25d0b1e38a on Jan 6, 2021
-
DrahtBot locked this on Feb 15, 2022
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-27 03:12 UTC
More mirrored repositories can be found on mirror.b10c.me