Should Consul.Builder#withMultipleHostAndPort require a positive blocklist (blacklist) time? #319
Closed
sleberknight
started this conversation in
Ideas
Replies: 1 comment
-
This will be fixed in #389 by requiring a positive timeout. We are not going to try to set a minimum, e.g., 10 milliseconds, because there is no "correct" value that applies to every situation. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Consul.Builder#withMultipleHostAndPort
allows a blocklist (blacklist) time of zero or some positive number of milliseconds. In one service, theConsul
instance was creating using the following in the builder code:Aside from the fact that
ConsulFailoverInterceptor
could infinite loop (see #304), having the blocklist time of zero also caused this. The reason is that the first URL in thehosts
was never blocked, and so it was tried every single time. There was an underlying problem with the certificate chain exceeding the maximum length.Had the time been even something like 50 milliseconds, the infinite loop would have been avoided, because each of the (three) Consul hosts would have been tried, all would have failed, and a
ConsulException
would have been thrown when all the hosts were blocked.It does not seem reasonable to allow zero as the time, since it means a specific host will never be blocked.
If we change so only allow a positive time argument, would this necessitate a major version change? It doesn't change a public API, though it does change behavior. But this could be considered a 🐛 instead of an enhancement or feature change, in which case it would only require a patch version change.
Beta Was this translation helpful? Give feedback.
All reactions