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 panic on empty findTraces query #3232

Merged
merged 6 commits into from
Aug 26, 2021

Conversation

akuzni2
Copy link
Contributor

@akuzni2 akuzni2 commented Aug 25, 2021

Which problem is this PR solving?

Closes #2996

Short description of the changes

Added validation checks to the gRPC server handler methods that implement the QueryServiceClient interface.

Couple of notes:

  • I created a gRPC Go client to attempt to test when the request parameters are nil - however the client looks like it panics before it reaches the server. Is there a way I can write a unit test for this functionality? As I understand it perhaps not all clients generated in other languages python, java, javascript etc... would fail before sending request to the server.
  • GetServices service method: the request parameter r *api_v2.GetServicesRequest not used so I didn't add any validation for it.

Questions for the following service methods

GetOperations

  • GetOperationsRequest parameters are Service and Span which are type String. Not sure what the behavior should be if they are "". Is it possible that these are valid arguments?

@akuzni2 akuzni2 requested a review from a team as a code owner August 25, 2021 02:55
@jpkrohling jpkrohling changed the title Fix sigsegv 2996 Fix panic on empty findTraces query Aug 25, 2021
jpkrohling
jpkrohling previously approved these changes Aug 25, 2021
Copy link
Contributor

@jpkrohling jpkrohling left a comment

Choose a reason for hiding this comment

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

Looks good, just two very minor improvements.

cmd/query/app/grpc_handler_test.go Outdated Show resolved Hide resolved
cmd/query/app/grpc_handler_test.go Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Aug 25, 2021

Codecov Report

Merging #3232 (dce6739) into master (7b0958d) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3232      +/-   ##
==========================================
- Coverage   95.99%   95.99%   -0.01%     
==========================================
  Files         242      242              
  Lines       14789    14813      +24     
==========================================
+ Hits        14197    14219      +22     
- Misses        513      515       +2     
  Partials       79       79              
Impacted Files Coverage Δ
cmd/query/app/grpc_handler.go 98.68% <100.00%> (+0.15%) ⬆️
cmd/flags/admin.go 81.25% <0.00%> (-1.57%) ⬇️
cmd/query/app/server.go 94.11% <0.00%> (-1.48%) ⬇️
plugin/storage/integration/integration.go 78.88% <0.00%> (-0.40%) ⬇️
plugin/storage/badger/spanstore/reader.go 96.21% <0.00%> (+0.70%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7b0958d...dce6739. Read the comment docs.

@jpkrohling
Copy link
Contributor

@akuzni2, do you think you can improve the test coverage of this PR?

Signed-off-by: Alex <alexmkuznicki@gmail.com>
…into fix-SIGSEGV-2996

� Conflicts:
�	cmd/query/app/grpc_handler_test.go
@akuzni2
Copy link
Contributor Author

akuzni2 commented Aug 25, 2021

@akuzni2, do you think you can improve the test coverage of this PR?

@jpkrohling - Thanks for reviewing! updated tests to meet code cov for the file which was changed cmd/query/app/grpc_handler.go.

Not sure why the Codecov report is showing my changes impacted the other files

Signed-off-by: Alex <alexmkuznicki@gmail.com>
@yurishkuro yurishkuro merged commit 0055bd8 into jaegertracing:master Aug 26, 2021
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.

SIGSEGV on empty grpc findTraces query
3 participants