python-consul icon indicating copy to clipboard operation
python-consul copied to clipboard

Add configurable request timeouts

Open benagricola opened this issue 9 years ago • 10 comments

As discussed in #45, this adds both a global consul.Consul(timeout=...) option, and request specific timeout option (e.g. c.kv.get('foo',timeout=...)). This will be applied as both a connect timeout and read timeout to each adapter, so requests could take up to twice this value to time out if they take a long time to connect and read.

Passes the existing tests on my local machine but I don't currently have access to a python 3.4 system or pypy system to test with.

Tests for the timeout options themselves may be a bit sparse and could do with some work, and the test for 'connect timeout' relies on setting a nonzero but tiny timeout to trigger before even a local connect is possible. Could fail randomly but not sure of a better way to test connection timeout at this point.

Thoughts? Improvements? Anything obvious I've missed?

benagricola avatar Feb 18 '16 14:02 benagricola

Some work to be done to fix the Python3 / AIO compatibility but a little tricky without a Python 3 development environment. Will get one sorted this weekend.

benagricola avatar Feb 18 '16 15:02 benagricola

@cablehead any thoughts on merging this? We also need this as described in https://github.com/cablehead/python-consul/pull/103#issue-155230281

mwicat avatar May 17 '16 11:05 mwicat

Hi @abn just checking why you've marked this one as not ready?

cablehead avatar Jul 02 '16 22:07 cablehead

@cablehead I hadn't completed revewing the changes and was pending testing with a rebase and cleanup. On my list of items for next week.

abn avatar Jul 05 '16 10:07 abn

Ah gotcha. All good. One thought I had (independent of whether to merge this) is it's tough to ensure broadly applied parameters are applied consistently atm. Related to: https://github.com/cablehead/python-consul/issues/68#issuecomment-230127111

cablehead avatar Jul 06 '16 17:07 cablehead

Any update on this being merged into master? This seems like a necessity to be able to control the timeout in requests.

dhv avatar Feb 13 '17 17:02 dhv

This is a fairly critical ask. What do we need to still do on this to get it merged?

beardedeagle avatar Jul 27 '17 05:07 beardedeagle

What is needed to get this merged in? Seems like it has been good to go for some years.

trastle avatar Aug 29 '19 01:08 trastle

Why hasn't this been merged yet?

ngerakines avatar Jul 15 '20 14:07 ngerakines

Any news on this one ?

kheraud avatar Feb 18 '22 12:02 kheraud