Nameko service crashed

Hi,

I have just started with Nameko. I am amazed by the simplicity of the Nameko framework and how it is so easy to develop services with this.

I tried with one sample service and integerated it with Flask using flask_nameko. Everything is working fine but i’m confused with one thing. It may sound silly but rpc and nameko is pretty new to me, so the thing is my worker/service got crashed suddenly, now when i try to hit the API, it just publishes the event in the queue and waits for the result while on the side, the worker is down; so it stucks permanently there.

Though i know about the circuit breaking concept in http based microservice where if one service is down, circuit breaks and we can return a default/custom response. So, can someone tell me how does circuit breaking thing can be apllied in the case of rpc based microservice.

My apologies if this is a stupid question, but i’m stuck with my development here on this thing. Kindly help me with some references.

This isn’t related to the circuit breaker pattern.

Nameko RPC intentionally retains the request queue in the RabbitMQ broker, so that requests are not lost if services go down temporarily. The RPC client does not time out (even though this is preferable in some cases) so it’s just waiting permanently for a response.

You’ll find that if you restart the failed service it will pick up the waiting request and try to produce a response.

Nameko will handle exceptions in worker methods gracefully, returning the exception to the caller. But if there’s an unhandled exception outside of the worker method it will terminate the service container and the process will exit – that’s what happened here.

Generally it’s a good idea to run Nameko services behind some kind of caretaker process that restarts them if they crash.

1 Like