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

p2p: fix frequent weak_ptr exception on connection #6269

Merged
merged 1 commit into from
Apr 4, 2020

Conversation

moneromooo-monero
Copy link
Collaborator

When a handshake fails, the handshake method was closing the
connection, and the caller was also doing so on error, triggering
the noisy (but harmless) exception.

@moneromooo-monero
Copy link
Collaborator Author

Actually, it doesn't seem to fix them all just yet. I'll have a followup...

@selsta
Copy link
Collaborator

selsta commented Mar 20, 2020

Please rebase.

@moneromooo-monero
Copy link
Collaborator Author

fixed

@selsta
Copy link
Collaborator

selsta commented Mar 31, 2020

looks like needs a rebase again

@moneromooo-monero
Copy link
Collaborator Author

fixed

When a handshake fails, it can fail due to timeout or destroyed
connection, in which case the connection will be, or already is,
closed, and we don't want to do it twice.
Additionally, when closing a connection directly from the top
level code, ensure the connection is gone from the m_connects
list so it won't be used again.

AFAICT this is now clean in netstat, /proc/PID/fd and print_cn.

This fixes a noisy (but harmless) exception.
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.

None yet

3 participants