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

0.11.9 failover link is skipped #80

Closed tcmorar closed 5 months ago

tcmorar commented 5 months ago

In case of URLError(TimeoutError('timed out')) for the first eureka server, the exception is not caught so there is not try to connect to the second eureka server. It looks that the http_client.URLError is not seen as the urllib.error.URLError (line 633).

Second problem is that applications() method which calls pull_full_registry() which is async method and it is not awaited (eureka_client.py line 559) which means it only creates coroutine but it can remain unexecuted. The logged error is: ...\pyicom\venv\Lib\site-packages\py_eureka_client\eureka_client.py:559: RuntimeWarning: coroutine 'EurekaClient.pull_full_registry' was never awaited self.__pull_full_registry()

tcmorar commented 5 months ago

Possible fix (I tested it and it works fine): image

keijack commented 5 months ago

Fix in 0.11.10, please check

tcmorar commented 5 months ago

Indeed the problem is solved in 0.11.10. Thanks for the fast reaction.