pphust commented on a change in pull request #8323: Make sure 
ReferenceCountingSegment.decrement() is invoked correctly when useCache=true
URL: https://github.com/apache/incubator-druid/pull/8323#discussion_r315059747
 
 

 ##########
 File path: server/src/main/java/org/apache/druid/client/CachingQueryRunner.java
 ##########
 @@ -92,6 +96,7 @@ public CachingQueryRunner(
     }
 
     if (useCache) {
+      close();
 
 Review comment:
   I have tested the duplicate decrement scenario. It seems there is some 
self-protect mechanism in `decrementOnceCloseable()` of 
ReferenceCountingSegment. So the program does not crash and just prints WARN 
message like "close() is called more than once on ReferenceCountingSegment".
   Anyway I agree with you so I move `close()` into `cachedResult != null` 
related statement and test it again. All looks good. I have added javadoc for 
CloseableCachingQueryRunner also.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to