Skip to content
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

close_connection doesn't close() because sock.shutdown crashes first. #259

Open
EternityForest opened this issue Aug 19, 2019 · 0 comments

Comments

@EternityForest
Copy link
Contributor

EternityForest commented Aug 19, 2019

When using cherrypy and ssl, for reasons I don't understand, the sock.shutdown call throws this error occasionally(When the source is modified to print tracebacks instead of silently pass).

Traceback (most recent call last):
  File "/home/daniel/Projects/KaithemAutomation/kaithem/src/thirdparty/ws4py/websocket.py", line 210, in close_connection
    self.sock.shutdown(socket.SHUT_RDWR)
  File "/usr/lib/python3.6/ssl.py", line 1050, in shutdown
    socket.shutdown(self, how)
OSError: [Errno 107] Transport endpoint is not connected

Seeing as how this is in the same try/except block as socket.close(), I presume that socket.close() is not always being called. Because of circular refs it might or might not get GCed right away, and if it does not, it may have something to do with some of the remaining bad behavior.

I will be testing with giving shutdown it's own try/except block and seeing how that goes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant