run_forever() terminates too early
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- python
- Domain
- networking
Research direction
Start in threadedclient.py at run_forever(), then inspect ws4py/websocket.py, especially terminate() and the client_terminated and server_terminated properties. Confirm that run_forever() waits until closed() has completed, including cleanup, before it returns.
Written by the indexing model from the issue text.
Description
I expect the run_forever() in threadedclient.py to return when the websocket has completely finished. However, it can return before the websocket's closed() method has returned.
The run_forver() method checks whether the terminated() method return true. However, ws4py/websocket.py terminate(), the client_terminated and server_terminated properties that terminate() checks are set to true in the beginning, before calling closed(). This means that if the closed() method takes some time (e.g., to do some cleanup), run_forver() returns before closed() has finished.
The solution would be to move the line
self.client_terminated = self.server_terminated = True
in ws4py/websocket.py to the finally block.
- Dominant language
- Python
- Stars
- 1.1k
- Forks
- 285
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
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 ·
-
This project is not well maintained so be very very very patient!May be free again @Lawouach claimed this 652 days ago, and no pull request is open. Openquestion
Lawouach/WebSocket-for-Python#297 · 2 comments · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 20/100
Lawouach/WebSocket-for-Python#296 ·
-
Make the codes python 3 compatibleMay be free again @auvipy claimed this 1059 days ago, and no pull request is open. Open
Lawouach/WebSocket-for-Python#280 · 1 comment · 1 assignee ·
-
Setup new CIMay be free again @auvipy claimed this 1230 days ago, and no pull request is open. Open
Lawouach/WebSocket-for-Python#275 · 1 assignee ·
All issues in Lawouach/WebSocket-for-Python
Similar issues
-
comp/tools duplicate P2 sweeper:risk-compatibility tool/mcp type/bug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
NousResearch/hermes-agent#132042 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
deepset-ai/haystack#13092 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
EverMind-AI/Raven#845 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
AstrBotDevs/AstrBot#10340 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
BasedHardware/omi#20401 · 1 comment ·
Maintainers usually reply within 1 day