BBVA / qed

The scalable, auditable and high-performance tamper-evident log project
https://qed.readthedocs.io/
Apache License 2.0
95 stars 19 forks source link

QED client library topology discovery timeout #88

Closed gdiazlo closed 5 years ago

gdiazlo commented 5 years ago

The configuration parameter DiscoveryTimeout is not used inside client.discover(). When creating a client with the default options, changing that timeout and setting an incorrect endpoint, the client creation hangs on the discover operation instead of timing out.

aalda commented 5 years ago

I think the hanging behavior is not related with the discovery process. The discovery process uses the same mechanism as regular requests to select a valid endpoint. If all endpoints have been marked previously as dead and the option attemptToRevive is set to false in the topology, subsequent round-robin rounds would not attempt to use them to make requests.

This commit should fix this problem by setting that option as true in all client configurations: https://github.com/BBVA/qed/commit/8dee3969ca58b153976789fb5cfb0e5ecf4c03c0

Anyway, the DiscoveryTimeout option is useless and should be deleted since it uses the same http.client instance as regular requests and the general Timeout option encompasses it.