-
Notifications
You must be signed in to change notification settings - Fork 735
sio::client destructor stuck indefinitely #254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think I ran into a similar issue. This problem is that that there's a timing problem with deleting the client when the code is trying to do a connection. How I fixed it was the following. Have a conditional variable called connecting and set it to false; In the code that you use to call connect(), do connecting = true;. In your set_socket_open_listener listener, have connecting = false; In your .socket()->on_error() listener, have connecting = false; Now check connecting before you delete sio::client. If it's true, you have to wait until it's false to delete. |
We faced the issue here too, on CentOS 7 / CentOS 6 hosts using the C++ client, The CPU was stuck at 100% in the Here's an unit test proving this issue in a permanent way: test.cpp docker run --rm -i -v "${PWD}:${PWD}" -w "${PWD}" centos:7.6.1810 <<EOF
yum install -y cmake gcc gcc-c++ make openssl-devel
cmake ./
make install
g++ -std=c++11 -Wall -lpthread -o test254 test.cpp /usr/local/lib/libsioclient.a
timeout -s9 10 ./test254
timeout -s9 10 ./test254 true
EOF |
* upstream/master: docs: update compatibility table for Socket.IO v4 docs: fix title format (socketio#297) feat: allow resource path to be set in connection URI (socketio#134) fix: resolve client_impl::ping LOG call syntax in debug builds fix: resolve socketio#254: handle closing sockets upon on_fail events fix: lower the minimum CMake supported version feat: implement socketio#45: add support for logging configuration feat: add support for Socket.IO v3 refactor: use correct Engine.IO protocol revision refactor: use standard install paths (socketio#58) ci: migrate to GitHub Actions chore: update .gitignore with cmake output refactor: remove Boost dependency (socketio#176)
Very similar problem as described, here, but no work-arounds would fix the issue. socketio#254 Similar fix described here: zaphoyd/websocketpp#805
Hi, I encountered an issue that happens sometimes, when the connection gets closed (i.e. a cable gets unplugged) during a session. Even in this scenatio it only happens sporadically.
In these cases, the destructor of sio::client is stuck forever.
The stack traces I found when trying to debug it are:
The thread it waits for is:
And I also found these two:
These specific stacktraces are from Win7x64, but I could reproduce it also on Win7x86 and Win10x64 with socket.io-client-cpp v1.6.1 (built using vcpkg).
To reproduce it what I did is:
As I said, only sporadically, the destructor gets stuck.
If you need any more information about this that I can get for you, please tell me.
The text was updated successfully, but these errors were encountered: