-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Handling of expected error codes coming from grpc storage plugins #1741 #1814
Handling of expected error codes coming from grpc storage plugins #1741 #1814
Conversation
…gertracing#1741 Signed-off-by: chandresh-pancholi <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #1814 +/- ##
=========================================
- Coverage 98.42% 98.4% -0.03%
=========================================
Files 197 197
Lines 9630 9633 +3
=========================================
+ Hits 9478 9479 +1
- Misses 116 117 +1
- Partials 36 37 +1
Continue to review full report at Codecov.
|
@@ -61,7 +61,7 @@ func (c *grpcClient) GetTrace(ctx context.Context, traceID model.TraceID) (*mode | |||
trace := model.Trace{} | |||
for received, err := stream.Recv(); err != io.EOF; received, err = stream.Recv() { | |||
if err != nil { | |||
return nil, errors.Wrap(err, "grpc stream error") | |||
return nil, spanstore.ErrTraceNotFound |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look right, why are you assuming that EVERY error from gRPC is "trace not found"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
…gertracing#1741 Signed-off-by: chandresh-pancholi <[email protected]>
}).Return(traceClient, nil) | ||
|
||
s, err := r.client.GetTrace(context.Background(), mockTraceID) | ||
assert.Error(t, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that doesn't test the issue, you probably want ErrorEquals method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or simply assert.Equals(t, spanstore.ErrTraceNotFound, err)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
…gertracing#1741 Signed-off-by: chandresh-pancholi <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
…#1741 (jaegertracing#1814) * Handling of expected error codes coming from grpc storage plugins jaegertracing#1741 Signed-off-by: chandresh-pancholi <[email protected]> * Handling of expected error codes coming from grpc storage plugins jaegertracing#1741 Signed-off-by: chandresh-pancholi <[email protected]> Signed-off-by: Ruben Vargas <[email protected]>
…#1741 (jaegertracing#1814) * Handling of expected error codes coming from grpc storage plugins jaegertracing#1741 Signed-off-by: chandresh-pancholi <[email protected]> * Handling of expected error codes coming from grpc storage plugins jaegertracing#1741 Signed-off-by: chandresh-pancholi <[email protected]> Signed-off-by: radekg <[email protected]>
…#1741 (jaegertracing#1814) * Handling of expected error codes coming from grpc storage plugins jaegertracing#1741 Signed-off-by: chandresh-pancholi <[email protected]> * Handling of expected error codes coming from grpc storage plugins jaegertracing#1741 Signed-off-by: chandresh-pancholi <[email protected]> Signed-off-by: Jonah Back <[email protected]>
Signed-off-by: chandresh-pancholi [email protected]
Which problem is this PR solving?
Short description of the changes