Coder Social home page Coder Social logo

Comments (5)

jimmycuadra avatar jimmycuadra commented on June 11, 2024

Can you clarify what you mean by leaking a connection?

from rust-etcd.

jmlMetaswitch avatar jmlMetaswitch commented on June 11, 2024

Sure, sorry.

As above I'm setting a 10s timeout on a watch and then repeating after 10s. This issues an http://etcd:2379/v2/keys/root?wait=true (from memory) every 10s with no response, as expected. If you run netstat -anp | grep -cE ":2379.*ESTABLISHED" you can see that the number of connections to etcd increments every 10s. Each connection is allocated an outbound TCP port. At that rate it takes about a week to run out of ports to connect from.

My understanding is that this is because the timeout configured in https://github.com/jimmycuadra/rust-etcd/blob/master/src/kv.rs#L531 has no way of cancelling the hyper connection, and the latter never times out. I've not really looked into hyper, but perhaps they don't think there is a problem: hyperium/hyper#1097.

I'm using (from Cargo.lock) etcd 0.8.0 and hyper 0.11.6.

from rust-etcd.

mthebridge avatar mthebridge commented on June 11, 2024

As linked above, I think this is a hyper bug which I've raised with them - or if it isn't, then I think it needs a better explanation of how to use timeouts for long-poll GETs!

from rust-etcd.

mthebridge avatar mthebridge commented on June 11, 2024

The underlying hyper bug is fixed as of v0.11.10, so taking that should fix this problem - could we update to this version? Happy to submit a PR if that would help.

from rust-etcd.

jimmycuadra avatar jimmycuadra commented on June 11, 2024

Should be fixed by f2574a2.

from rust-etcd.

Related Issues (14)

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.