Skip to content

Conversation

@vasild
Copy link
Contributor

@vasild vasild commented May 8, 2024

It is expected to have some Bitcoin nodes unreachable some of the time. A failure to connect to an IPv4 or IPv6 node is already properly logged under category=net/severity=debug. Do the same when a connection fails when using a SOCKS5 proxy. This could be either to an .onion address or to an IPv4 or IPv6 address (via a Tor exit node).

Related: #29759

@DrahtBot
Copy link
Contributor

DrahtBot commented May 8, 2024

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK mzumsande, tdb3, achow101
Concept ACK jonatack, BrandonOdiwuor
Stale ACK laanwj, kristapsk

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #29641 (scripted-diff: Use LogInfo/LogDebug over LogPrintf/LogPrint by maflcko)

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.

Copy link
Member

@laanwj laanwj left a comment

Choose a reason for hiding this comment

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

Agree these don't need to be logged at high severity, this matches our general idea that network problems on the open internet are normal and there's no reason to scream at the user for them.
ACK 7524aaf58f5dbe077d4997b3a5dcf635a027a659

Copy link
Contributor

@kristapsk kristapsk left a comment

Choose a reason for hiding this comment

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

cr utACK 7524aaf58f5dbe077d4997b3a5dcf635a027a659

Copy link
Member

@jonatack jonatack left a comment

Choose a reason for hiding this comment

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

Concept ACK, a0be62c (#25203) from two years ago contains these changes and further ones, perhaps look if other ones there could be done here.

src/netbase.cpp Outdated
Copy link
Member

Choose a reason for hiding this comment

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

In this case, I had added Manual and considered it an error (or perhaps warning), what do you think: a0be62c#diff-3499e52d708f04ebd0bfeec799dd26464ca6bd26a802c700460227c4f41ec4b5R541

Suggested change
LogPrintLevel(BCLog::NET, BCLog::Level::Info, "%s\n", error_message);
LogPrintLevel(BCLog::NET, BCLog::Level::Error, "Manual %s\n", error_message);

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that the change in this line should be explained better / maybe be its own commit. LogConnectFailure is not related to SOCKS5 but also reached through ConnectDirectly(), so it's not clear to me from the commit msg or PR description why the log is changed.

Copy link
Contributor Author

@vasild vasild May 31, 2024

Choose a reason for hiding this comment

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

Dropped this hunk altogether. It was more or less cosmetic, giving a category to a category-less message - for manual connection failures: category=none/severity=info -> category=net/severity=info.

Copy link
Contributor

@BrandonOdiwuor BrandonOdiwuor left a comment

Choose a reason for hiding this comment

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

Concept ACK

Copy link
Contributor

@mzumsande mzumsande left a comment

Choose a reason for hiding this comment

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

Concept ACK

src/netbase.cpp Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that the change in this line should be explained better / maybe be its own commit. LogConnectFailure is not related to SOCKS5 but also reached through ConnectDirectly(), so it's not clear to me from the commit msg or PR description why the log is changed.

It is expected to have some Bitcoin nodes unreachable some of the time.
A failure to connect to an IPv4 or IPv6 node is already properly logged
under category=net/severity=debug. Do the same when a connection fails
when using a SOCKS5 proxy. This could be either to an .onion address or
to an IPv4 or IPv6 address (via a Tor exit node).

Related: bitcoin#29759
@vasild vasild force-pushed the consistently_log_connection_failures branch from 7524aaf to f3cfbd6 Compare May 31, 2024 05:07
@vasild
Copy link
Contributor Author

vasild commented May 31, 2024

7524aaf58f...f3cfbd65f5: drop the changes to LogConnectFailure(). They were somewhat related, but not directly to the SOCKS5 stuff.

perhaps look if other ones there could be done here

The changes from #25203 look sound, but I want to keep this PR small, just to address the noisy and inconsistent logging due to connection failures via the SOCKS5 proxy.

Copy link
Contributor

@mzumsande mzumsande left a comment

Choose a reason for hiding this comment

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

Code Review ACK f3cfbd6

Copy link
Contributor

@tdb3 tdb3 left a comment

Choose a reason for hiding this comment

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

Code Review ACK f3cfbd6

@achow101
Copy link
Member

achow101 commented Aug 5, 2024

ACK f3cfbd6

@achow101 achow101 merged commit 44a4a01 into bitcoin:master Aug 5, 2024
@vasild vasild deleted the consistently_log_connection_failures branch August 12, 2024 04:55
@bitcoin bitcoin locked and limited conversation to collaborators Aug 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants