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

Frontend: do not return 500 if the user request cancellation. #2156

Merged

Conversation

cyriltovena
Copy link
Contributor

Signed-off-by: Cyril Tovena cyril.tovena@gmail.com

As discussed with @pracucci , This change how the frontend handle cancellation/timeout.

If the user request/upstream cancellation, then we don't throw a 5xx but a 499 instead (I'm happy to choose another code).

However in case of deadline exceeded/timeout, or unknown error we're sending back a 500.

The reason for this change is because if a user quickly cancel a request (page refresh) before it has time to answer the frontend will register this as an error (500) which I don't think we should.

@cyriltovena cyriltovena changed the title Frontent does not return 500 if the user request cancellation. Frontend does not return 500 if the user request cancellation. Feb 18, 2020
@cyriltovena cyriltovena changed the title Frontend does not return 500 if the user request cancellation. Frontend: do not return 500 if the user request cancellation. Feb 18, 2020
@cyriltovena cyriltovena force-pushed the context-cancellation-frontend branch from 743d45f to f9cc565 Compare February 18, 2020 21:11
Copy link
Contributor

@tomwilkie tomwilkie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one nit.

Copy link
Contributor

@pracucci pracucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm in big favour of this change. Thanks for it! LGTM (after Tom's comment is addressed and PR rebased due to the conflict)

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
@cyriltovena cyriltovena force-pushed the context-cancellation-frontend branch from e502429 to 8c68773 Compare February 19, 2020 13:55
@pracucci pracucci merged commit baae166 into cortexproject:master Feb 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants