This is an automated email from the ASF dual-hosted git repository.

yashmayya pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 4749eeea91 Fix MSE worker thread initialization for TSE. (#15905)
4749eeea91 is described below

commit 4749eeea91ce63d6b2d763204b53cdda4379c625
Author: RAGHVENDRA KUMAR YADAV <[email protected]>
AuthorDate: Mon May 26 19:39:12 2025 -0700

    Fix MSE worker thread initialization for TSE. (#15905)
---
 .../apache/pinot/query/service/server/QueryServer.java    | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git 
a/pinot-query-runtime/src/main/java/org/apache/pinot/query/service/server/QueryServer.java
 
b/pinot-query-runtime/src/main/java/org/apache/pinot/query/service/server/QueryServer.java
index d5f14d6da5..6c196bc875 100644
--- 
a/pinot-query-runtime/src/main/java/org/apache/pinot/query/service/server/QueryServer.java
+++ 
b/pinot-query-runtime/src/main/java/org/apache/pinot/query/service/server/QueryServer.java
@@ -397,17 +397,18 @@ public class QueryServer extends 
PinotQueryWorkerGrpc.PinotQueryWorkerImplBase {
   @Override
   public void submitTimeSeries(Worker.TimeSeriesQueryRequest request,
       StreamObserver<Worker.TimeSeriesResponse> responseObserver) {
-    CompletableFuture.runAsync(() -> submitTimeSeriesInternal(request, 
responseObserver), _timeSeriesExecutorService);
+    try (QueryThreadContext.CloseableContext qCtx = QueryThreadContext.open();
+        QueryThreadContext.CloseableContext mseCtx = 
MseWorkerThreadContext.open()) {
+      // TODO: populate the thread context with TSE information
+      QueryThreadContext.setQueryEngine("tse");
+
+      CompletableFuture.runAsync(() -> submitTimeSeriesInternal(request, 
responseObserver), _timeSeriesExecutorService);
+    }
   }
 
   private void submitTimeSeriesInternal(Worker.TimeSeriesQueryRequest request,
       StreamObserver<Worker.TimeSeriesResponse> responseObserver) {
-    try (QueryThreadContext.CloseableContext queryTlClosable = 
QueryThreadContext.open();
-        QueryThreadContext.CloseableContext mseTlCloseable = 
MseWorkerThreadContext.open()) {
-      // TODO: populate the thread context with TSE information
-      QueryThreadContext.setQueryEngine("tse");
-      _queryRunner.processTimeSeriesQuery(request.getDispatchPlanList(), 
request.getMetadataMap(), responseObserver);
-    }
+    _queryRunner.processTimeSeriesQuery(request.getDispatchPlanList(), 
request.getMetadataMap(), responseObserver);
   }
 
   /// Executes a cancel request.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to