To verify the improved accuracy of the documentation here one can apply:
0diff --git a/src/httpserver.cpp b/src/httpserver.cpp
1index 52fa8463d2..a3efaa2579 100644
2--- a/src/httpserver.cpp
3+++ b/src/httpserver.cpp
4@@ -557,6 +557,10 @@ void StopHTTPServer()
5 // Schedule a callback to call evhttp_free in the event base thread, as
6 // otherwise eventHTTP often keeps internal events alive, meaning
7 // aforementioned thread would never run out of events and exit.
8+ while (true) {
9+ event_base_dump_events(eventBase, stderr);
10+ std::this_thread::sleep_for(5s);
11+ }
12 if (event_base_once(eventBase, -1, EV_TIMEOUT, [](evutil_socket_t, short, void*) {
13 evhttp_free(eventHTTP);
14 eventHTTP = nullptr;
Run bitcoind, and then send the stop-RPC from bitcoin-cli. It gave me the following log:
02025-02-22T15:18:19Z [http] Stopping HTTP server
12025-02-22T15:18:19Z [http] Waiting for HTTP worker threads to exit
2Inserted events:
32025-02-22T15:18:19Z [http] Exited http event loop
4 0x555556947a50 [fd 11] Read Persist Internal
5Active events:
62025-02-22T15:18:19Z net thread exit
72025-02-22T15:18:20Z msghand thread exit
8Inserted events:
9 0x555556947a50 [fd 11] Read Persist Internal
10Active events:
11Inserted events:
12 0x555556947a50 [fd 11] Read Persist Internal
13Active events:
14Inserted events:
15 0x555556947a50 [fd 11] Read Persist Internal
16Active events:
17<repeated until killing the process>