saltosaurus opened a new issue, #10714:
URL: https://github.com/apache/pinot/issues/10714

   I'm digging into an issue with OOM errors and a memory leak of some kind 
using the java-client and jdbc connections to Pinot.  Eventually our Spring 
Boot application dies with:
   Exception: java.lang.OutOfMemoryError thrown from the 
UncaughtExceptionHandler in thread "AsyncHttpClient-timer-1820-1"
   In digging into this I found 
https://github.com/AsyncHttpClient/async-http-client/issues/1658, the important 
part (considering I see hundreds of threads marked AsyncHttpClient-timer-X-1) 
of which is:
   AsyncHttpClient-x-x: I/O (twice number of cores)
   AsyncHttpClient-timer: timer for timeouts (only one)
   
   Any different number means you're creating multiple clients.
   I dug into the Pinot code where this issue seems to be coming from and found 
where it's creating an AsyncHttpClient:
   
[https://github.com/apache/pinot/blob/3e1aba37deee21ccb2e764afce789e463098246f/pino[…]/org/apache/pinot/client/JsonAsyncHttpPinotClientTransport.java](https://github.com/apache/pinot/blob/3e1aba37deee21ccb2e764afce789e463098246f/pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/JsonAsyncHttpPinotClientTransport.java#L69)
   
[https://github.com/apache/pinot/blob/3e1aba37deee21ccb2e764afce789e463098246f/pino[…]rg/apache/pinot/client/controller/PinotControllerTransport.java](https://github.com/apache/pinot/blob/3e1aba37deee21ccb2e764afce789e463098246f/pinot-clients/pinot-jdbc-client/src/main/java/org/apache/pinot/client/controller/PinotControllerTransport.java#L70)
   
https://github.com/apache/pinot/blob/master/pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/BrokerCache.java#L120
   The problem here as I see it is that the docs for AsyncHttpClient say
   `AsyncHttpClient instances are intended to be global resources that share 
the same lifecycle as the application. Typically, AHC will usually underperform 
if you create a new client for each request, as it will create new threads and 
connection pools for each.`
   which the Pinot java client is clearly not doing, and looking at the classes 
that create these client it's up to other code that's using them to close them. 
I think this is resulting in client (and their respective threadpools) being 
kept around in parallel causing memory leakage.


-- 
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: commits-unsubscr...@pinot.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to