Initialize OOM protection in GrpcQueryServer#15271
Open
jitendrakr88 wants to merge 1 commit intoapache:masterfrom
Open
Initialize OOM protection in GrpcQueryServer#15271jitendrakr88 wants to merge 1 commit intoapache:masterfrom
jitendrakr88 wants to merge 1 commit intoapache:masterfrom
Conversation
cbalci
reviewed
Mar 14, 2025
| _grpcQueryServer.submit(serverRequest, _responseObserver); | ||
|
|
||
| // Assert: ThreadAccountantOps.setupRunner() was called once. | ||
| mockedStatic.verify(() -> Tracing.ThreadAccountantOps.setupRunner(anyString()), times(1)); |
Contributor
There was a problem hiding this comment.
This test is fine, but can we write a test case which actually validates the gRPC query server can execute queries?
The reason I'm insistent on the test is that the Grpc transport is secondary to the the HttpServer in terms of importance and when folks do sweeping changes (like the tracing setup), regressions to the gRPC server slip unnoticed.
| import static org.mockito.Mockito.*; | ||
|
|
||
| public class GrpcQueryServerTest { | ||
| private GrpcQueryServer _grpcQueryServer; |
Contributor
There was a problem hiding this comment.
(minor) Please fix the format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When OOM protection is enabled, the grpc streming queries always return 0 rows. This issue has been observered with spark connector as well as trino connector (reported by another user).
Observation:
useGrpcServeroption, the query works fine with http transport.Solution
This PR fixes the issue by initialising the missing tracing context in GrpcQueryServer for OOM protection.