Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gateway never returns 500 #79

Closed
kevburnsjr opened this issue Oct 26, 2019 · 1 comment
Closed

Gateway never returns 500 #79

kevburnsjr opened this issue Oct 26, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@kevburnsjr
Copy link
Contributor

API Requests to rudder-server will only ever return a status code of 200 or 400.

if errorMessage != "" {
logger.Debug(errorMessage)
http.Error(w, errorMessage, 400)
} else {
logger.Debug(respMessage)
w.Write([]byte(respMessage))
}

This is problematic for at least 2 reasons

1) Lack of differentiation between 400 and 500 reduces visibility into service operation.

Services should differentiate between client errors and server errors. If the database becomes unavailable, you want the service to return 500 so that your alerting system can page the OPS team.

2) Clients treat 4xx and 5xx differently

Some clients will retry events when they receive a 500 and remove events when they receive a 400.

https://github.com/segmentio/analytics-android/blob/47f7341d81766b1b4a101ef69f491835d11f7532/analytics/src/main/java/com/segment/analytics/SegmentIntegration.java#L386-L394

The service must return 5xx on server error in order to minimize event loss during service outage.

@gitcommitshow gitcommitshow added the enhancement New feature or request label Jun 14, 2022
@chandumlg
Copy link
Member

Gateway error codes are corrected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants