Skip to content

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

Merged
pracucci merged 5 commits into
cortexproject:masterfrom
cyriltovena:context-cancellation-frontend
Feb 19, 2020
Merged

Frontend: do not return 500 if the user request cancellation.#2156
pracucci merged 5 commits into
cortexproject:masterfrom
cyriltovena:context-cancellation-frontend

Conversation

@cyriltovena

Copy link
Copy Markdown
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
Comment thread pkg/querier/frontend/frontend.go Outdated

@tomwilkie tomwilkie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM with one nit.

@pracucci pracucci left a comment

Copy link
Copy Markdown
Contributor

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>
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