keijack / python-eureka-client

A eureka client written in python. Support registering your python component to Eureka Server, as well as calling remote services by pulling the the Eureka registry.
MIT License
183 stars 43 forks source link

There is a way to catch failed heartbeats? #42

Closed brenramz closed 3 years ago

brenramz commented 3 years ago

There is a way to catch failed heartbeats when all servers are down? As I see in the documentation urllib HTTPError can raise it on do_service, but I'm getting 'NoneType' object has no attribute 'get_application'

keijack commented 3 years ago

It seems not only the heartbeat failed, the whole Registry was not pulled in your case? Could you show me some logs?

brenramz commented 3 years ago

Well, I figure out was the error, the resourse was not available, other process erase it, but I still having the problem when eureka.init() cant not connect, because eureka server is down, I can't catch the error, just get a lot of exceptions like every 30 seconds.

image

image

brenramz commented 3 years ago

I'm using

eureka_client.init(
    eureka_server=eureka._ervers,
    app_name=app_name,
    instance_port=instance_port,
    instance_host=instance_host
)
keijack commented 3 years ago

It seems there is a Timeout when visiting your eureka server, could you please use curl [your eureka server] in your machine to check if you can reach the registry server.

keijack commented 3 years ago

For no response for a week, I close this. If you have any problem, please submit anther issue.