tower
tower copied to clipboard
Add a tower-fallback similar to linkerd2-fallback?
I'd like to be able to compose two Services, S1 and S2, such that requests are sent to S1 and then retried on S2 if the first request fails. @hawkw pointed out that this is similar to linkerd2-fallback:
https://github.com/linkerd/linkerd2-proxy/blob/8b6f9a09968ca844e5c7bcbf924c045d4797541b/linkerd/fallback/src/lib.rs
which works for MakeServices.
Would it make sense to add similar functionality to tower itself as a tower-fallback crate? I would be happy to write it but I wanted to check if it makes sense first.
FWIW, linkerd/linkerd2-proxy#432 will change the Linkerd fallback implementation you mentioned to operate at the Service level, rather than on Layers producing MakeServices only. I think that may make it more applicable in a wider range of use-cases, so we might want to consider upstreaming it into tower in that form?
That would be great!