sonatype-lift[bot] commented on code in PR #1158: URL: https://github.com/apache/solr/pull/1158#discussion_r1031540437
########## solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java: ########## @@ -2165,46 +2165,14 @@ protected SolrClient createNewSolrClient(int port) { return createNewSolrClient(DEFAULT_COLLECTION, port); } - protected SolrClient createNewSolrClient( - int port, int connectionTimeoutMillis, int socketTimeoutMillis) { - return createNewSolrClient( - DEFAULT_COLLECTION, port, connectionTimeoutMillis, socketTimeoutMillis); - } - protected SolrClient createNewSolrClient(String coreName, int port) { - try { - // setup the server... - String baseUrl = buildUrl(port); - String url = baseUrl + (baseUrl.endsWith("/") ? "" : "/") + coreName; - SolrClient client = getHttpSolrClient(url, DEFAULT_CONNECTION_TIMEOUT, 60000); - return client; - } catch (Exception ex) { - throw new RuntimeException(ex); - } - } - - protected SolrClient createNewSolrClient( - String coreName, int port, int connectionTimeoutMillis, int socketTimeoutMillis) { - try { - // setup the server... - String baseUrl = buildUrl(port); - String url = baseUrl + (baseUrl.endsWith("/") ? "" : "/") + coreName; - SolrClient client = getHttpSolrClient(url, connectionTimeoutMillis, socketTimeoutMillis); - return client; - } catch (Exception ex) { - throw new RuntimeException(ex); - } + String baseUrl = buildUrl(port); + String url = baseUrl + (baseUrl.endsWith("/") ? "" : "/") + coreName; + return getHttpSolrClient(url, DEFAULT_CONNECTION_TIMEOUT, 60000); Review Comment: ![26% of developers fix this issue](https://lift.sonatype.com/api/commentimage/fixrate/26/display.svg) đŦ 2 similar findings have been found in this PR --- *THREAD_SAFETY_VIOLATION:* Unprotected write. Non-private method `AbstractFullDistribZkTestBase.createNewSolrClient(...)` indirectly mutates container `util.ObjectReleaseTracker.OBJECTS` via call to `Map.put(...)` outside of synchronization. Reporting because another access to the same memory occurs on a background thread, although this access may not. --- <details><summary><b>đ Expand here to view all instances of this finding</b></summary><br/> <div align="center"> | **File Path** | **Line Number** | | ------------- | ------------- | | solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java | [2175](https://github.com/epugh/solr/blob/acde86bfb2a43624ffc2df4ec791cd7ad494449b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java#L2175)| | solr/test-framework/src/java/org/apache/solr/SolrJettyTestBase.java | [161](https://github.com/epugh/solr/blob/acde86bfb2a43624ffc2df4ec791cd7ad494449b/solr/test-framework/src/java/org/apache/solr/SolrJettyTestBase.java#L161)| <p><a href="https://lift.sonatype.com/results/github.com/apache/solr/01GJMW794KN7GJMJC17P5CM4ET?t=Infer|THREAD_SAFETY_VIOLATION" target="_blank">Visit the Lift Web Console</a> to find more details in your report.</p></div></details> --- <details><summary><b>âšī¸ Learn about @sonatype-lift commands</b></summary> You can reply with the following commands. For example, reply with ***@sonatype-lift ignoreall*** to leave out all findings. | **Command** | **Usage** | | ------------- | ------------- | | `@sonatype-lift ignore` | Leave out the above finding from this PR | | `@sonatype-lift ignoreall` | Leave out all the existing findings from this PR | | `@sonatype-lift exclude <file\|issue\|path\|tool>` | Exclude specified `file\|issue\|path\|tool` from Lift findings by updating your config.toml file | **Note:** When talking to LiftBot, you need to **refresh** the page to see its response. <sub>[Click here](https://github.com/apps/sonatype-lift/installations/new) to add LiftBot to another repo.</sub></details> --- Was this a good recommendation? [ [đ Not relevant](https://www.sonatype.com/lift-comment-rating?comment=355304250&lift_comment_rating=1) ] - [ [đ Won't fix](https://www.sonatype.com/lift-comment-rating?comment=355304250&lift_comment_rating=2) ] - [ [đ Not critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=355304250&lift_comment_rating=3) ] - [ [đ Critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=355304250&lift_comment_rating=4) ] - [ [đ Critical, fixing now](https://www.sonatype.com/lift-comment-rating?comment=355304250&lift_comment_rating=5) ] -- 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: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org