Skip to content

Instantly share code, notes, and snippets.

@cmelbye
Created April 10, 2015 01:44

Revisions

  1. cmelbye created this gist Apr 10, 2015.
    15 changes: 15 additions & 0 deletions limitConn.Close
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    goroutine 74122 [semacquire]:
    sync.(*Mutex).Lock(0xc214391ea0)
    /usr/local/go/src/sync/mutex.go:66 +0xd3
    google.golang.org/appengine/internal.(*limitConn).Close(0xc214391ea0, 0x0, 0x0)
    google.golang.org/appengine/internal/net.go:61 +0x45
    net/http.(*persistConn).closeLocked(0xc209ea6e70)
    /usr/local/go/src/net/http/transport.go:1147 +0x55
    net/http.(*persistConn).close(0xc209ea6e70)
    /usr/local/go/src/net/http/transport.go:1141 +0x73
    net/http.(*Transport).putIdleConn(0xc208052120, 0xc209ea6e70, 0xc20b534fc0)
    /usr/local/go/src/net/http/transport.go:402 +0x30d
    net/http.func·016()
    /usr/local/go/src/net/http/transport.go:508 +0x9e
    created by net/http.func·017
    /usr/local/go/src/net/http/transport.go:513 +0xba
    23 changes: 23 additions & 0 deletions limitConn.Read
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    goroutine 268781 [IO wait]:
    net.(*pollDesc).Wait(0xc212e53870, 0x72, 0x0, 0x0)
    /usr/local/go/src/net/fd_poll_runtime.go:84 +0x47
    net.(*pollDesc).WaitRead(0xc212e53870, 0x0, 0x0)
    /usr/local/go/src/net/fd_poll_runtime.go:89 +0x43
    net.(*netFD).Read(0xc212e53810, 0xc21c889000, 0x1000, 0x1000, 0x0, 0x7f107e8ccd98, 0xc212a06fa0)
    /usr/local/go/src/net/fd_unix.go:242 +0x40f
    net.(*conn).Read(0xc21524e1f0, 0xc21c889000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/net.go:121 +0xdc
    google.golang.org/appengine/internal.(*limitConn).Read(0xc213d268e0, 0xc21c889000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    google.golang.org/appengine/internal/net.go:57 +0xfd
    net/http.noteEOFReader.Read(0x7f107e8cea28, 0xc213d268e0, 0xc209ea72e8, 0xc21c889000, 0x1000, 0x1000, 0x7f107e8bb010, 0x0, 0x0)
    /usr/local/go/src/net/http/transport.go:1270 +0x6e
    net/http.(*noteEOFReader).Read(0xc213d26900, 0xc21c889000, 0x1000, 0x1000, 0xc2072db1df, 0x0, 0x0)
    <autogenerated>:125 +0xd4
    bufio.(*Reader).fill(0xc214ec2600)
    /usr/local/go/src/bufio/bufio.go:97 +0x1ce
    bufio.(*Reader).Peek(0xc214ec2600, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/bufio/bufio.go:132 +0xf0
    net/http.(*persistConn).readLoop(0xc209ea7290)
    /usr/local/go/src/net/http/transport.go:842 +0xa4
    created by net/http.(*Transport).dialConn
    /usr/local/go/src/net/http/transport.go:660 +0xc9f
    11 changes: 11 additions & 0 deletions limitDial
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    goroutine 144036 [chan send, 15 minutes]:
    google.golang.org/appengine/internal.limitDial(0x8a2900, 0x3, 0xc209ed5b00, 0x1e, 0x0, 0x0, 0x0, 0x0)
    google.golang.org/appengine/internal/net.go:31 +0x81
    net/http.(*Transport).dial(0xc208052120, 0x8a2900, 0x3, 0xc209ed5b00, 0x1e, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/http/transport.go:479 +0x84
    net/http.(*Transport).dialConn(0xc208052120, 0x0, 0x898500, 0x4, 0xc209ed5b00, 0x1e, 0x443b79, 0x0, 0x0)
    /usr/local/go/src/net/http/transport.go:564 +0x1678
    net/http.func·019()
    /usr/local/go/src/net/http/transport.go:520 +0x42
    created by net/http.(*Transport).getConn
    /usr/local/go/src/net/http/transport.go:522 +0x335