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

Fix error handling in gRPC query API #6139

Merged
merged 2 commits into from
Feb 20, 2023

Conversation

fpetkovski
Copy link
Contributor

The gRPC query api does not propagate errors from the promql engine to the upstream client. This causes calls against it to fail silently without any error messages. Noticed while testing the distributed query mode.

This commit changes the API to propagate errors and warnings as warn messages. The client can then decide whether to abort on each message type, or to proceed with execution and present a partial response message to the user.

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

  • Fix error handling in gRPC query API.

Verification

Added unit tests.

The gRPC query api does not propagate errors from the promql engine
to the upstream client. This causes calls against it to fail silently
without any error messages. Noticed while testing the distributed
query mode.

This commit changes the API to propagate errors and warnings as
warn messages. The client can then decide whether to abort on each
message type, or to proceed with execution and present a partial
response message to the user.

Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>
@fpetkovski fpetkovski force-pushed the grpc-api-error-handling branch from c34d3d8 to b6eca0a Compare February 19, 2023 10:53
Signed-off-by: fpetkovski <filip.petkovsky@gmail.com>
@fpetkovski fpetkovski force-pushed the grpc-api-error-handling branch from b6eca0a to d09af91 Compare February 19, 2023 10:53
Copy link
Member

@saswatamcode saswatamcode left a comment

Choose a reason for hiding this comment

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

LGTM!

@GiedriusS GiedriusS merged commit 9c0e177 into thanos-io:main Feb 20, 2023
ngraham20 pushed a commit to ngraham20/thanos that referenced this pull request Apr 17, 2023
* Fix error handling in gRPC query API

The gRPC query api does not propagate errors from the promql engine
to the upstream client. This causes calls against it to fail silently
without any error messages. Noticed while testing the distributed
query mode.

This commit changes the API to propagate errors and warnings as
warn messages. The client can then decide whether to abort on each
message type, or to proceed with execution and present a partial
response message to the user.

Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>

* Add warning tests and license header

Signed-off-by: fpetkovski <filip.petkovsky@gmail.com>

---------

Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>
Signed-off-by: fpetkovski <filip.petkovsky@gmail.com>
ngraham20 pushed a commit to ngraham20/thanos that referenced this pull request Apr 17, 2023
* Fix error handling in gRPC query API

The gRPC query api does not propagate errors from the promql engine
to the upstream client. This causes calls against it to fail silently
without any error messages. Noticed while testing the distributed
query mode.

This commit changes the API to propagate errors and warnings as
warn messages. The client can then decide whether to abort on each
message type, or to proceed with execution and present a partial
response message to the user.

Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>

* Add warning tests and license header

Signed-off-by: fpetkovski <filip.petkovsky@gmail.com>

---------

Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>
Signed-off-by: fpetkovski <filip.petkovsky@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants