Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

run_forever() terminates too early

Aperta
#152 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
python
Ambito
networking

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

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.

Lingua principale
Python
Stelle
1.1k
Fork
285
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Lawouach/WebSocket-for-Python

Tutte le issue di Lawouach/WebSocket-for-Python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.