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

TCPSocket specs hang if client doesn't connect

Aperta
#925 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
ruby

Direzione di ricerca

Leggi il fixture TCPSocket in library/socket/fixtures/classes.rb intorno alle righe 125-129, concentrandoti sull’arresto del server e su Thread#join. Esegui le test di TCPSocket#initialize con un client che non riesce a connettersi, quindi verifica che chiudere il server prima del join impedisca alla suite di bloccarsi e gestisca qualsiasi errore di doppia chiusura.

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

Descrizione

The TCPSocket#initialize specs will hang if the client socket does not connect to the server, since the shutdown for the server expects that it will have handled a request and be wrapping up here:

https://github.com/ruby/spec/blob/master/library/socket/fixtures/classes.rb#L125-L129

I found this while adding support for the new connect_timeout keyword; we do not support hash arguments on TCPSocket#initialize at the moment, so the socket never connects. This leaves the server waiting for an incoming connection, and the Thread#join above will hang the suite.

Perhaps we should actively try to close the server socket before we join the thread, and ignore any errors on the thread from a double-close? It would allow these specs to be a bit more robust when there are errors setting up the TCPSocket before connection.

Lingua principale
Ruby
Stelle
622
Fork
402
Merge medio
14h 51m
PR unite (30g)
6

Guida per i contributori

Apri la guida per i contributori

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 ruby/spec

Tutte le issue di ruby/spec

Issue simili

Altre issue su Ruby

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.