jnturton commented on PR #2698:
URL: https://github.com/apache/calcite/pull/2698#issuecomment-1092407150

   > I understand that you want to properly manage resource lifecycle. Is there 
a reason you can't share existing `ElasticsearchSchema` ?
   > 
   > Is there a way in your environment to manually instantiate 
`ElasticsearchSchema` with existing `RestClient` instance (see 
[ElasticsearchSchema 
ctor](https://github.com/apache/calcite/blob/master/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchSchema.java#L65)?
 This way you can control when `RestClient` is closed.
   
   @asereda-gs I can see if we can lift the rest client management out to Drill 
but do you really want to retain the situation where this library creates 
internal objects that allocate OS resources and never calls `close()` on them, 
either of its own accord or in response to some message from the application?
   
   Surely that's just bad library code and now we're arguing "yes it leaks but 
applications that are in position to to do a lot of reuse can make that a slow 
leak, alternatively they can not use the API in the obvious way and do their 
own resource management.  So we don't need to fix the library"?  You have to 
think that there are probably many applications out there using Calcite with 
slow resource leaks today as a result.


-- 
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]

Reply via email to