Giter Site home page Giter Site logo

Comments (4)

lavagetto avatar lavagetto commented on June 29, 2024

Can you add a sample code that would reproduce this?

I'm not sure the problem is where you are thinking it is.

from python-etcd.

cyap13 avatar cyap13 commented on June 29, 2024

Ok the bug occurs when you have an incorrect port.
host_list = (
('host1', 4000), # incorrect port
('host2', 4001), # never gets here because TimeoutError not caught and handled
)
c = Client(host=host_list, read_timeout=5, allow_reconnect=True, allow_redirect=True)

from python-etcd.

lavagetto avatar lavagetto commented on June 29, 2024

So... if you have an incorrect configuration you get an exception. Not that strange, but I'll try to handle that gracefully - it's not easy, as a TimeoutError can happen also because you reached the urllib request timeout.

from python-etcd.

lavagetto avatar lavagetto commented on June 29, 2024

Also, trying to reproduce your bug, I get a different (as expected) error - urllib3.exceptions.MaxRetryError just when I try to instantiate etcd.Client

>>> host_list = ( ('127.0.0.1', 4000), ('127.0.0.1', 4001) )
>>> c = etcd.Client(host=host_list, read_timeout=5, allow_reconnect=True, allow_redirect=True)
[CUT]
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=4000): Max retries exceeded with url: /v2/machines (Caused by ProtocolError('Connection aborted.', error(111, 'Connection refused')))

Which is a perfectly fine way to fail in my opinion, but I can handle that gracefully I guess.

Still, this is not the problem you reported, so...

from python-etcd.

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.