Introduce rpc_host and run every RPC owner on it (#5173) * Introduce `rpc_host` and run every owner on it Every owner composed the same three things by hand, an HTTP listener, the backend that serves its requests and the IO threads they run on, and each spelled out its own order for stopping them; the test harness copied the daemon's order with nothing pinning the two together. `rpc_host` owns the composition. `start` binds the listener and runs the backend on the host's own IO threads, `stop` closes the listener, stops the threads and releases the backend, once. `nano_rpc`, the daemon, the wallet, the RPC test harness and the slow test wrapper run on it, so in-process RPC now serves on threads sized by the existing `[process] io_threads` setting instead of the node's. `rpc_server::stop` becomes idempotent, since on host threads a handler closing the listener from an IO thread runs concurrently with the owner's stop; the bound port is cached at start so it stays readable after the acceptor is closed, and a cancelled accept is no longer logged as an error. A `bind_failure` test that Windows cannot satisfy skips itself through new `consteval` platform predicates beside the sanitizer ones. * Guard the RPC acceptor against a close racing its accept handler The accept handler re-arms the acceptor on an IO thread and checked `is_open` on it, while the owner closes the acceptor from its own thread. With the listener on the host's own IO threads the two run concurrently, which ThreadSanitizer reported in `rpc_host.destroy_without_stop`. Both now take the server's mutex, and the handler consults the stopped flag instead of the acceptor.
__________
Type: commit
Hash: a5aab87c4b66902c8d4a2ea3657e57a8704f1518
Created: yesterday
__________
gr0v1ty/nano-node:a5aab87c4b66902c8d4a2ea3657e57a8704f1518
| Test Case | Status | Duration | Median Deviation | Log | Graph |
|---|---|---|---|---|---|
| 5n4pr_conf_10k_bintree | PASS | 106 s | -8.0 s | - | Show |
| 5n4pr_conf_10k_change | PASS | 182 s | 40.0 s | - | Show |
| 5n4pr_conf_change_dependant | PASS | 107 s | -9.0 s | - | - |
| 5n4pr_conf_change_independant | PASS | 120 s | 4.0 s | - | - |
| 5n4pr_conf_send_dependant | PASS | 124 s | 11.0 s | - | - |
| 5n4pr_conf_send_independant | PASS | 110 s | -9.0 s | - | - |
| 5n4pr_rocks_10k_bintree | PASS | 114 s | -2.0 s | - | - |
| 5n4pr_rocks_10k_change | PASS | 175 s | 13.0 s | - | - |