Spring-cloud-netflix: When an upstream microservice is unavailable (ex. no servers are up) Zuul sends a 500 Internal Server Error instead of 503 Service Unavailable

Created on 29 Aug 2016  路  6Comments  路  Source: spring-cloud/spring-cloud-netflix

This is a special case of https://github.com/spring-cloud/spring-cloud-netflix/issues/406. The fix for 406 addresses situations where the upstream microservice sends a 503. However, if the upstream service is completely unavailable, Zuul sends back a 500 error where as ideally it should be a 503 service unavailable.

In such cases, Ribbon throws a ClientException exception of type 'GENERAL' with the message 'Load balancer does not have available servers for client: XXX', which gets converted to 500 by RibbonRoutingFilter.

IMO, this should be mapped to more specific 503 service unavailable instead of a generic 500 error so that the downstream services can handle this scenario gracefully.

[I am using Brixton SR3]

enhancement help wanted

Most helpful comment

I'll help in this issue ok @spencergibb?

All 6 comments

I'll help in this issue ok @spencergibb?

I create the issue and PR in Ribbon project to return the SERVICE_UNAVAILABLE when no servers are up. When the PR merged I update the version on spring-cloud-netflix project.

The changes in Ribbon LGTM, but I am not too familiar with that project either.

@FelipeAdorno
Is the PR merged?
Could you please tell me about the issue's url in Ribbon project?

Sorry, I found it above.

This module has entered maintenance mode. This means that the Spring Cloud team will no longer be adding new features to the module. We will fix blocker bugs and security issues, and we will also consider and review small pull requests from the community.

Was this page helpful?
0 / 5 - 0 ratings