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

TTL health check broken when passed int

Open ariscn opened this issue 10 years ago • 1 comments

I burned a few hours on this, so hopefully this will save the next person a future headache.

I used python-consul to register a new service, with a corresponding health check. Next, I tried setting the service to healthy with: `consul.agent.check.ttl_pass('service:MY_SERVICE_ID').

This was completely ignored by Consul, which would return a 200 OK but leave the health check in a critical state.

The problem ended up being that I initialized the check as Check.ttl(60). This should be Check.ttl('60s'). I'm not sure what Consul does with an integer TTL, but it's nothing good. It expects a string TTL, so python-consul should probably cast it before sending it on.

ariscn avatar Dec 12 '15 23:12 ariscn

This is very related to: https://github.com/cablehead/python-consul/pull/70

Need to think through a comprehensive plan to handling time values consistently and sanely.

cablehead avatar Feb 07 '16 20:02 cablehead