Skip to content

Fix/connection cleanup and log severity - #63

Open
secretnamebasis wants to merge 2 commits into
DEROFDN:community-devfrom
secretnamebasis:fix/connection-cleanup-and-log-severity
Open

Fix/connection cleanup and log severity#63
secretnamebasis wants to merge 2 commits into
DEROFDN:community-devfrom
secretnamebasis:fix/connection-cleanup-and-log-severity

Conversation

@secretnamebasis

Copy link
Copy Markdown

Description

Two related fixes in the connection pool's cleanup and health-check paths:

  • Connection_Pending_Clear()'s HANDSHAKE_PENDING branch called v.exit() but never
    Connection_Delete(v), leaving stale entries in the connection map even after the pending
    handshake 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 the V(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's
    actually happening.

Also includes a no-op style cleanup (time.Now().Sub(x)time.Since(x)) on the adjacent
idle-check line touched by the first fix.

NOTE: The process is the following:

  • Your pull request should be directed to dev branch.
  • When it will be merged in dev, we will merge it to testnet for tests, and then into main for final release.

Fixes # (issue)

Type of change

Please select the right one.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • This will require a HardFork to be enabled

Which part is impacted ?

  • Wallet
  • Daemon
  • Miner
  • Explorer
  • Simulator
  • Misc (documentation, comments, text...)

Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings

License

I'm am contributing & releasing the code under DERO Research License (which can be found here).

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.

1 participant