Open goldyfruit opened 1 year ago
this happens when the connection is closed too fast i think, will happen in all the cli apps that emit a bus message and immediately exit
same as https://github.com/OpenVoiceOS/ovos-bus-server/issues/3
this happens when the connection is closed too fast i think, will happen in all the cli apps that emit a bus message and immediately exit
same as #3
Indeed, the server crashes because the thread is closed too quickly; cf: https://stackoverflow.com/questions/7381757/c-terminate-called-without-an-active-exception
Adding a sleep time.sleep(0.2)
before the client.close()
prevent the server to crash. https://github.com/OpenVoiceOS/ovos-bus-client/blob/dev/ovos_bus_client/scripts.py
quoting self in chat:
well, it boils down (as that StackOverflow link explains) to what the C++ standard has applications do for thread safety. what's going on here is, your dep is still in the process of joining the thread created by the connecting client when the client disconnects. disconnecting puts the handler out of scope before it's joined. the program crashes rather than leaving detached threads
options: become more involved in all the threading this server is doing. introduce that hardcoded sleep to the clients. rewrite this in golang.