You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by Sai Sandeep Rangisetti via Review Board <no...@reviews.apache.org> on 2023/05/18 06:38:38 UTC
Re: Review Request 74170: RANGER-3947 fix thread leak in SolrCollectionBootstrapper
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74170/
-----------------------------------------------------------
(Updated May 18, 2023, 6:38 a.m.)
Review request for ranger, Abhay Kulkarni, Madhan Neethiraj, Nikhil P, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
Changes
-------
Updated log level to warning from severe
Bugs: RANGER-3947
https://issues.apache.org/jira/browse/RANGER-3947
Repository: ranger
Description
-------
Closing the solr cloud client in SolrCollectionBootstrapper's retry loop of creating solr config and collection. Without this new solr cloud client is created in every loop and new connection pools which will not be cleaned up and create large number of threads
Diffs (updated)
-----
embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBootstrapper.java fe4006f76
Diff: https://reviews.apache.org/r/74170/diff/2/
Changes: https://reviews.apache.org/r/74170/diff/1-2/
Testing
-------
Ran ranger-admin without ranger_audit config in zk and no contrib/solr_for_audit_setup/conf file which leads to retry loop and verified that threads aren't increasinng
Thanks,
Sai Sandeep Rangisetti
Re: Review Request 74170: RANGER-3947 fix thread leak in SolrCollectionBootstrapper
Posted by Pradeep Agrawal <pr...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74170/#review225490
-----------------------------------------------------------
Ship it!
Ship It!
- Pradeep Agrawal
On May 18, 2023, 6:38 a.m., Sai Sandeep Rangisetti wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74170/
> -----------------------------------------------------------
>
> (Updated May 18, 2023, 6:38 a.m.)
>
>
> Review request for ranger, Abhay Kulkarni, Madhan Neethiraj, Nikhil P, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
>
>
> Bugs: RANGER-3947
> https://issues.apache.org/jira/browse/RANGER-3947
>
>
> Repository: ranger
>
>
> Description
> -------
>
> Closing the solr cloud client in SolrCollectionBootstrapper's retry loop of creating solr config and collection. Without this new solr cloud client is created in every loop and new connection pools which will not be cleaned up and create large number of threads
>
>
> Diffs
> -----
>
> embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBootstrapper.java fe4006f76
>
>
> Diff: https://reviews.apache.org/r/74170/diff/2/
>
>
> Testing
> -------
>
> Ran ranger-admin without ranger_audit config in zk and no contrib/solr_for_audit_setup/conf file which leads to retry loop and verified that threads aren't increasinng
>
>
> Thanks,
>
> Sai Sandeep Rangisetti
>
>
Re: Review Request 74170: RANGER-3947 fix thread leak in SolrCollectionBootstrapper
Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74170/#review225491
-----------------------------------------------------------
Fix it, then Ship it!
embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBootstrapper.java
Lines 204 (patched)
<https://reviews.apache.org/r/74170/#comment314058>
solrCloudClient and solrClient are assigned to the same value. After closing solrCloudClient, shouldn't following members be reset?
solrCloudClient = null;
solrClient = null;
is_completed = false;
retry_counter = 0;
It looks like above members don't have scope beyond run() method. In that case, to make it clearer, consider moving these to a local variable inside run() method. Also, consider using try-with-resource to handle automatic close:
try (CloudSolrClient solrCloudClient = connect(zookeeperHosts)) {
} catch (Exception ex)
...
}
embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBootstrapper.java
Line 223 (original), 231 (patched)
<https://reviews.apache.org/r/74170/#comment314059>
It looks like solr_cloud_mode=true is the only mode supported in SolrCollectionBootstrapper. If true, consider eliminating this member.
- Madhan Neethiraj
On May 18, 2023, 6:38 a.m., Sai Sandeep Rangisetti wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74170/
> -----------------------------------------------------------
>
> (Updated May 18, 2023, 6:38 a.m.)
>
>
> Review request for ranger, Abhay Kulkarni, Madhan Neethiraj, Nikhil P, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
>
>
> Bugs: RANGER-3947
> https://issues.apache.org/jira/browse/RANGER-3947
>
>
> Repository: ranger
>
>
> Description
> -------
>
> Closing the solr cloud client in SolrCollectionBootstrapper's retry loop of creating solr config and collection. Without this new solr cloud client is created in every loop and new connection pools which will not be cleaned up and create large number of threads
>
>
> Diffs
> -----
>
> embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBootstrapper.java fe4006f76
>
>
> Diff: https://reviews.apache.org/r/74170/diff/2/
>
>
> Testing
> -------
>
> Ran ranger-admin without ranger_audit config in zk and no contrib/solr_for_audit_setup/conf file which leads to retry loop and verified that threads aren't increasinng
>
>
> Thanks,
>
> Sai Sandeep Rangisetti
>
>
Re: Review Request 74170: RANGER-3947 fix thread leak in SolrCollectionBootstrapper
Posted by Kishor Gollapalliwar <ki...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74170/#review225489
-----------------------------------------------------------
Ship it!
Ship It!
- Kishor Gollapalliwar
On May 18, 2023, 6:38 a.m., Sai Sandeep Rangisetti wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74170/
> -----------------------------------------------------------
>
> (Updated May 18, 2023, 6:38 a.m.)
>
>
> Review request for ranger, Abhay Kulkarni, Madhan Neethiraj, Nikhil P, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
>
>
> Bugs: RANGER-3947
> https://issues.apache.org/jira/browse/RANGER-3947
>
>
> Repository: ranger
>
>
> Description
> -------
>
> Closing the solr cloud client in SolrCollectionBootstrapper's retry loop of creating solr config and collection. Without this new solr cloud client is created in every loop and new connection pools which will not be cleaned up and create large number of threads
>
>
> Diffs
> -----
>
> embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBootstrapper.java fe4006f76
>
>
> Diff: https://reviews.apache.org/r/74170/diff/2/
>
>
> Testing
> -------
>
> Ran ranger-admin without ranger_audit config in zk and no contrib/solr_for_audit_setup/conf file which leads to retry loop and verified that threads aren't increasinng
>
>
> Thanks,
>
> Sai Sandeep Rangisetti
>
>
Re: Review Request 74170: RANGER-3947 fix thread leak in SolrCollectionBootstrapper
Posted by Mehul Parikh <xs...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74170/#review225488
-----------------------------------------------------------
Ship it!
Ship It!
- Mehul Parikh
On May 18, 2023, 6:38 a.m., Sai Sandeep Rangisetti wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74170/
> -----------------------------------------------------------
>
> (Updated May 18, 2023, 6:38 a.m.)
>
>
> Review request for ranger, Abhay Kulkarni, Madhan Neethiraj, Nikhil P, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
>
>
> Bugs: RANGER-3947
> https://issues.apache.org/jira/browse/RANGER-3947
>
>
> Repository: ranger
>
>
> Description
> -------
>
> Closing the solr cloud client in SolrCollectionBootstrapper's retry loop of creating solr config and collection. Without this new solr cloud client is created in every loop and new connection pools which will not be cleaned up and create large number of threads
>
>
> Diffs
> -----
>
> embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBootstrapper.java fe4006f76
>
>
> Diff: https://reviews.apache.org/r/74170/diff/2/
>
>
> Testing
> -------
>
> Ran ranger-admin without ranger_audit config in zk and no contrib/solr_for_audit_setup/conf file which leads to retry loop and verified that threads aren't increasinng
>
>
> Thanks,
>
> Sai Sandeep Rangisetti
>
>