Test Details Overview

Reject a channel whose endpoint is already registered (#5280)

* Reject a channel whose endpoint is already registered

The channel registry holds one entry per remote IP and port, but
check () only treated a new channel as a duplicate when it came from
the same IP under the same node ID. A channel at a registered
endpoint under another node ID passed the check and then failed to
insert: debug builds stopped on an assert, release builds returned it
as accepted without registering it.

check () now rejects such a channel as a duplicate, counted under its
own stat, whether the registered channel is alive or dead. A dead
channel keeps its endpoint until purge removes it, as it already does
for a reconnect under the same node ID, so create () never closes a
channel on the io thread it runs on. With the endpoint checked under
the same lock the insert cannot fail, and a release assert guards it.

* Check the endpoint is free before building a channel

create () now looks the endpoint up again right before it builds the
channel, under the same lock as the insert, so the insert cannot fail
and its release assert stays unreachable. A channel built for a
registered endpoint could not be dropped there: its destructor joins
its tasks, and create () runs on an io thread.

The accepted stat, the log line and the reachout attempt erase now
follow the insert.

__________

Type: commit

Hash: 6574123a8fceac265d01008892872d004eac05a0

Created: yesterday

__________

gr0v1ty/nano-node:6574123a8fceac265d01008892872d004eac05a0

Test Results

Test Case Status Duration Median Deviation Log Graph
5n4pr_conf_10k_bintree PASS 94 s -19.0 s GitHub job logs Show
5n4pr_conf_10k_change PASS 128 s -7.0 s GitHub job logs Show
5n4pr_conf_change_dependant PASS 115 s 0.0 s GitHub job logs -
5n4pr_conf_change_independant PASS 107 s -5.0 s GitHub job logs -
5n4pr_conf_send_dependant PASS 137 s 23.0 s GitHub job logs -
5n4pr_conf_send_independant PASS 124 s 11.0 s GitHub job logs -
5n4pr_rocks_10k_bintree PASS 119 s 6.0 s GitHub job logs -
5n4pr_rocks_10k_change FAIL 3 s -157.0 s Test log -