Test Details Overview

Drop a connection whose accept throws instead of stopping the listener (#5299)

* Drop a connection whose accept throws instead of stopping the listener

Until socket errors became return values, accept_one and the connection
observers it notifies ran inside a try block of the accept loop and of
connect_impl. Without it an exception from them reached start_impl,
which takes every boost::system::system_error for the cancellation of
its accept: a release build stopped accepting connections and a debug
build asserted. In connect_impl it ended the attempt's task, which
nothing reads, so the connect callback never ran.

accept_one becomes admit, and the accept loop and connect_impl reach it
through accept_guarded, which also notifies the observers and keeps an
exception from either to the connection being admitted. It counts an
accept_error in the connection's direction, logs the exception at error
level, closes the connection if it was already tracked, so the cleanup
evicts it, and returns accept_result::error. The accept loop counts
that as a failed accept and goes on, and a connect callback is told
error_common::exception.

Two new tests have an observer throw, once for a connection a peer
opened and once for a connection the node opened.

* Log an exception that ends a connection attempt

An exception thrown out of an outbound connection attempt, in practice
by its connect callback, ended the attempt's task, and nothing reads
the result of that task, so it was lost. The task now runs
connect_guarded, which awaits connect_impl through nano::async::settle
and logs such an exception at error level.

__________

Type: commit

Hash: f432091bf8a9b79efa063748b875094bb7e37237

Created: yesterday

__________

gr0v1ty/nano-node:f432091bf8a9b79efa063748b875094bb7e37237

Test Results

Test Case Status Duration Median Deviation Log Graph
5n4pr_conf_10k_bintree PASS 105 s 0.0 s GitHub job logs Show
5n4pr_conf_10k_change PASS 111 s -11.0 s GitHub job logs Show
5n4pr_conf_change_dependant PASS 105 s -4.0 s GitHub job logs -
5n4pr_conf_change_independant PASS 100 s -6.0 s GitHub job logs -
5n4pr_conf_send_dependant PASS 95 s -13.0 s GitHub job logs -
5n4pr_conf_send_independant PASS 97 s -13.0 s GitHub job logs -
5n4pr_rocks_10k_bintree PASS 105 s 0.0 s GitHub job logs -
5n4pr_rocks_10k_change PASS 152 s 0.0 s GitHub job logs -