Skip to content

net/http: when test times out, there are too many goroutines #4821

Closed
@rsc

Description

@rsc
net/http test timed out in TestTransportPersistConnLeak.
I don't know why and for the purposes of this bug don't care.
But there are 129 goroutines sitting around, which seems like too many.
They come from:

   1 created by net.newPollServer
  24 created by net/http.(*Server).Serve
  70 created by net/http.(*Transport).getConn
   1 created by net/http.(*timeoutHandler).ServeHTTP
   1 created by net/http.fileTransport.RoundTrip
   2 created by net/http/httptest.(*Server).Start
  25 created by net/http_test.TestTransportPersistConnLeak
   1 created by net/http_test.testHandlerPanic
   1 created by testing.RunTests
   1 created by time.goFunc

Why are there 70 created by getConn? That seems like too many. Are they left over from
earlier tests? Are things not being cleaned up correctly?

Full goroutine dump attached.

Attachments:

  1. httpcrash.txt (85003 bytes)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions