-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Killing the client (e.g., without calling DualClient::stop() ) makes subsequent re-connection to the server impossible.
ra2yrcpp/src/websocket_server.cpp
Lines 103 to 112 in ee215f5
| s.set_close_handler([&](connection_hdl h) { | |
| try { | |
| const unsigned int socket_id = s.get_socket_id(h); | |
| cb_.close(socket_id); | |
| (void)ws_conns.erase(socket_id); | |
| iprintf("closed conn {}", socket_id); | |
| } catch (const std::exception& e) { | |
| eprintf("close_handler: {}", e.what()); | |
| } | |
| }); |
After adding some logs, I can see the WebSocket server stuck in the "close handler". Specifically, the std::map::erase() call didn't return.
I suspect that it's because of utility::worker_util in the SocketEntry, but utility::worker_util's destructor ended normally.
Line 58 in ee215f5
| ~worker_util() { work.push(work_item{true, {}, nullptr}); } |
The log (omitted the timestamp and the only one thread):
INFO: websocket_server.cpp:operator():86 connection from 172.20.0.1
INFO: websocket_server.cpp:operator():86 connection from 172.20.0.1
INFO: websocket_server.cpp:operator():107 erase ing
INFO: auto_thread.hpp:~worker_util:58 dtor done
INFO: websocket_server.cpp:operator():109 erase done
INFO: websocket_server.cpp:operator():110 closed conn 424
INFO: websocket_server.cpp:operator():107 erase ing
INFO: auto_thread.hpp:~worker_util:58 dtor done
INFO: websocket_server.cpp:operator():109 erase done
INFO: websocket_server.cpp:operator():110 closed conn 400
INFO: websocket_server.cpp:operator():86 connection from 172.20.0.1
INFO: websocket_server.cpp:operator():86 connection from 172.20.0.1
INFO: websocket_server.cpp:operator():107 erase ing
INFO: auto_thread.hpp:~worker_util:58 dtor done
Debugging Win32 program in wine in Docker is painful to me. Since shmocz wrote:
The core component and it's related tests do not depend on Windows
I think I should be able to find the culprit easier.