alfg / alfg/blockchain

New client has no default timeout and may hang on slow network

Aperta
#4 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Go
Stelle
45
Fork
19
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

The New constructor currently returns an http.Client with Timeout=0, which means requests can wait indefinitely on network stalls.

Reproduction command:

sandbox-exec -f /tmp/no-network4.sb env GO111MODULE=off go test -run TestNewClientSetsTimeout -count=1 ./...

Observed output before fix:
- FAIL: expected positive timeout, got 0s

Expected behavior:
- New clients should set a bounded default timeout so requests fail predictably under network issues.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.