smallrye / smallrye-stork

SmallRye Stork is a service discovery and client side-load balancing framework.
http://smallrye.io/smallrye-stork/
Apache License 2.0
81 stars 23 forks source link

Handling failures in Composite SD #957

Open aureamunoz opened 1 month ago

aureamunoz commented 1 month ago

At the moment, the implementation fails if any of the sub-discovery mechanisms fail to find a matching service instance. The failure should only occur if none of the sub-discovery mechanisms find a matching instance or if all of them fail.

Proposed Solution If one sub-discovery fails but another successfully provides a service instance, the system should pass the available instance rather than failing altogether. This would allow the service to continue with whichever discovery method succeeds, rather than relying on all methods to be successful.

Related to https://github.com/smallrye/smallrye-stork/discussions/952

famod commented 1 month ago

First off: thanks for tracking this!

I'm wondering whether users should be given a choice how the Composite SD shall react if one of the composed discovery services fails/is not available. I'm thinking of something like:

WDYT?

cescoffier commented 1 month ago

I agree, it should be a strategy. The default might be "fail" to avoid changing the current behavior.

aureamunoz commented 1 month ago

+1. Giving users the choice on how the Composite Service Discovery should react to failures sounds like a very flexible and user-friendly approach