Fix/connection cleanup and log severity - #63
Open
secretnamebasis wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Two related fixes in the connection pool's cleanup and health-check paths:
Connection_Pending_Clear()'sHANDSHAKE_PENDINGbranch calledv.exit()but neverConnection_Delete(v), leaving stale entries in the connection map even after the pendinghandshake had timed out and the connection had exited. Those stale entries could block future
connection attempts from the same peer/IP. Now it deletes the map entry too, matching the
pattern already used for the idle-purge case a few lines below.
ping_loop()logged every failed ping (peer went offline, transient network blip — a routine,expected event) at
.Error()severity. Unlike.Info(),.Error()calls bypass theV(N)verbosity gate entirely, so this always printed regardless of log level, adding noise that made
real errors harder to spot. Changed to
.V(2).Info(...)to match the severity of what'sactually happening.
Also includes a no-op style cleanup (
time.Now().Sub(x)→time.Since(x)) on the adjacentidle-check line touched by the first fix.
NOTE: The process is the following:
devbranch.dev, we will merge it totestnetfor tests, and then intomainfor final release.Fixes # (issue)
Type of change
Please select the right one.
Which part is impacted ?
Checklist:
License
I'm am contributing & releasing the code under DERO Research License (which can be found here).