-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
Description
by tarmigan:
Rev 96744c61ffcf "gc: fix copy([]int, string) error message" When I run the attached program on OSX, the http.Get() dnslookup fails after a while in C.getaddrinfo in cgo_unix.go. Once the dns lookup fails, I get "open main.go: too many open files". So I think dns lookup is failing because there are too many open files. lsof on the process lists around 261 open files once it's hung. (osx open file limit is a low 256 by default). I believe the problem is with (*http.Response).Body.Close() for a gzipped response. When the response is gzip enabled, the body will be gzip.NewReader. The Close() method on a gzip Reader will NOT close the original connection, but will only close the decompressor created by flate.NewReader(). If I comment out line 536 of src/pkg/http/transport.go the problem goes away. Not sure what the correct fix is, so I'm only creating an issue. Thanks, Tarmigan Which compiler are you using (5g, 6g, 8g, gccgo)? Which operating system are you using? Which revision are you using? (hg identify) Please provide any additional information below.
Attachments:
- main.go (685 bytes)