Git Product home page Git Product logo

Comments (2)

manugarg avatar manugarg commented on April 28, 2024

Looking at http://<cloudprober_host>:9313/debug/pprof/goroutines, we noticed that:

For 72 failing targets:
1080 goroutines are in transport.dial and eventually in internal/poll.runtime_pollWait.
1080 goroutines in net.(*netFD).connect.func2+0xb9 net/fd_unix.go:129
1008 goroutines in net/http.(*Transport).getConn.func2.1+0x49 net/http/transport.go:965

from cloudprober.

manugarg avatar manugarg commented on April 28, 2024

I think client.Timeout is not having the desired effect on the underlying connection calls and we should switch to using request based contexts (when this probe was implemented HTTP requests didn't support contexts).

So this is what seems to be happening:

  1. client.Timeout gets attached to the request in the form of a "Cancel" channel (req.Cancel) which gets closed at the deadline (set to time.Until(deadline)): src/net/http/client.go#L284

  2. http.Transport's getConn() function is where most of HTTP level connection handling happens:
    net/http/transport.go:948

  3. This function uses the req.Cancel to come out of itself when req.Cancel is closed, but AFAICT, it doesn't do much to close the pending connections. It calls handlePendingDial but all that seems to be doing is decreasing the outstanding connections count:
    http://google3/third_party/go/gc/src/net/http/transport.go?l=962&rcl=207119865

So even though, the HTTP request gets canceled at the timeout, underlying goroutines that handle TCP connections don't finish.

from cloudprober.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.