close_connection doesn't close() because sock.shutdown crashes first.
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- networking
Research direction
Start in ws4py/websocket.py at close_connection and inspect how shutdown and close are handled for SSL sockets. Reproduce the CherryPy/SSL failure if possible, then verify that socket.close() is still reached when shutdown raises the reported OSError.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Python
- Stars
- 1.1k
- Forks
- 285
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Lawouach/WebSocket-for-Python
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Lawouach/WebSocket-for-Python#300 ·
-
question
Lawouach/WebSocket-for-Python#297 · 2 comments · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 20/100
Lawouach/WebSocket-for-Python#296 ·
-
Lawouach/WebSocket-for-Python#280 · 1 comment · 1 assignee ·
-
Setup new CI Open
Lawouach/WebSocket-for-Python#275 · 1 assignee ·
All issues in Lawouach/WebSocket-for-Python
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100