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

pool: Cleanup client read error logging. #376

Merged
merged 2 commits into from
Sep 16, 2023

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented Sep 15, 2023

This is rebased on #375.

This switches the code that examines read errors for timeout to use the proper interface from the net package that is designed for that purpose instead of digging into concrete types.

It also ensures clients that timeout without ever identifying themselves have their uniquely-assigned extra nonce used as the id instead so the log messages can be attributed to the ip of the offending clients.

Finally, it no longer logs an error when an io.EOF is encountered as that is an expected condition when the client disconnects and is not an actual error.

@davecgh davecgh force-pushed the pool_cleanup_read_err_logging branch from 64250f3 to 2c4dd87 Compare September 16, 2023 00:38
This ensures the send to the read channel for a client respects the
context since it could otherwise end up hanging forever when sending to
the channel that no longer has a goroutine reading from it thereby
leaking the goroutine.

It also includes the read goroutine in the overall waitgroup for the
client to help ensure it shuts down as intended.
Copy link
Member

@jholdstock jholdstock left a comment

Choose a reason for hiding this comment

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

Good after rebase.

This switches the code that examines read errors for timeout to use the
proper interface from the net package that is designed for that purpose
instead of digging into concrete types.

It also ensures clients that timeout without ever identifying themselves
have their uniquely-assigned extra nonce used as the id instead so the
log messages can be attributed to the ip of the offending clients.

Finally, it no longer logs an error when an io.EOF is encountered as
that is an expected condition when the client disconnects and is not an
actual error.
@davecgh davecgh force-pushed the pool_cleanup_read_err_logging branch from 2c4dd87 to 84cc283 Compare September 16, 2023 08:44
@jholdstock jholdstock merged commit 20ceef5 into decred:master Sep 16, 2023
2 checks passed
@davecgh davecgh deleted the pool_cleanup_read_err_logging branch September 16, 2023 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants