FAQ
Has to correct myself:

resp could of course be nil, so use this edited code:
http://play.golang.org/p/FjSSZkysYF

Den mandag den 19. januar 2015 kl. 17.38.20 UTC+1 skrev akib...@gmail.com:
Hi Everyone,

I hope this isn't a duplicate issue but:

I have a number of goroutines that each download a url. After a certain
cutoff point (a timeout), main code execution moves on, leaving goroutines
that didn't finish basically hanging.

See: http://play.golang.org/p/OlPuERL2kQ

Doing this, I'm getting:
net/http.(*persistConn).writeLoop(0xc208351810)
/root/.gvm/gos/go1.4rc2/src/net/http/transport.go:945 +0x41d
created by net/http.(*Transport).dialConn
/root/.gvm/gos/go1.4rc2/src/net/http/transport.go:661 +0xcbc
panic: send on closed channel

I found an SO that suggests that resp.Body is probably causing the issue:
http://stackoverflow.com/questions/25152030/panic-in-golang-http-client-with-high-concurrent-excecutions
But the SO doesn't specify the best way to fix this.

Is reading resp.Body the likely source of error?
What would be the best way to handle this?

Thanks,
Aki
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 15 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedJan 19, '15 at 4:38p
activeJan 21, '15 at 3:59p
posts15
users4
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase