kfaraz commented on code in PR #18170:
URL: https://github.com/apache/druid/pull/18170#discussion_r2184146665


##########
server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java:
##########
@@ -634,6 +634,7 @@ public ListenableFuture<Object> persistAll(@Nullable final 
Committer committer)
                      numPersistedRows, bytesPersisted, persistMillis
             );
             log.info("Persist is done.");
+            clearTaskThreadContext();

Review Comment:
   Yeah, I set out to do that originally. But then I realized that these 
threads are not reused for another task ID. They are always freshly created for 
each task.
   
   
https://github.com/apache/druid/blob/00c0d57e5ca762cf8931be43350da64b8a365e1e/server/src/main/java/org/apache/druid/segment/realtime/appenderator/BatchAppenderator.java#L224-L242
   
   
https://github.com/apache/druid/blob/00c0d57e5ca762cf8931be43350da64b8a365e1e/server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java#L1246-L1268
   
   Please let me know if you feel that adding the try-finally makes for cleaner 
code.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to