0

Suppose I have two deployments, D_a and D_b and they each have a replica of 1. Ideally this would get me two running pods P_a and P_b.

Now suppose both P_a and P_b contain gRPC services which periodically ping each other to establish their readinesss state.

I now have a circular dependency between the two and I will never be able to get them ready as each one of them won't be ready for the other one to become ready.

Is this an anti-pattern or perhaps I am completely missing the point of readiness probes?

How would I break this loop? Thank you in advance!

Lucat
  • 2,242
  • 1
  • 30
  • 41
  • 1
    If A depends on B, B should not depend on A. If B 'needs' something from A ("something-x")....."something-x" should be moved to C. – granadaCoder Oct 18 '22 at 16:37
  • 1
    The other question is: do we *really* want our services to be taken out of the load balancer, just because a downstream service fails? Maybe it's better reporting an error to the client/frontend instead of "going offline". – Turing85 Oct 18 '22 at 16:42
  • @granadaCoder you raise an excellent point. I guess it is a microservice architecture issue if there's a circular dependency. – Lucat Oct 19 '22 at 08:28
  • @Turing85 thanks this is another valid point! Especially when one has gRPC microservices with many endpoints then the failure of a dependency used for a portion of them should not prevent the others from working. – Lucat Oct 19 '22 at 08:29

0 Answers0