You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2022/05/06 16:20:35 UTC

[GitHub] [solr] risdenk opened a new pull request, #841: SOLR-16046: Thread leak in TestLeaderElectionZkExpiry

risdenk opened a new pull request, #841:
URL: https://github.com/apache/solr/pull/841

   https://issues.apache.org/jira/browse/SOLR-16046
   
   * Move `Thread killer` to an executor just to make sure it gets cleaned up
   * Ensure `SolrZkClient zc = new SolrZkClient(server.getZkAddress(), LeaderElectionTest.TIMEOUT))` is closed with try w/ resources
   * reorganize some of the try/finally to ensure things are closed in the reverse order of when they were opened


-- 
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-unsubscribe@solr.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] risdenk commented on pull request #841: SOLR-16046: Thread leak in TestLeaderElectionZkExpiry

Posted by GitBox <gi...@apache.org>.
risdenk commented on PR #841:
URL: https://github.com/apache/solr/pull/841#issuecomment-1234557833

   > It should execute in the same order, unless there's something "magical" about this being done from a different thread?
   
   @magibney I think this is because it is trying to expire the ZK session in the background?
   
   > should we still try and get this in?
   
   @HoustonPutman we can. I don't think this makes things worse? At least based on the discussion in SOLR-16046 I'm pretty sure it won't fix everything.


-- 
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-unsubscribe@solr.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] epugh commented on a diff in pull request #841: SOLR-16046: Thread leak in TestLeaderElectionZkExpiry

Posted by GitBox <gi...@apache.org>.
epugh commented on code in PR #841:
URL: https://github.com/apache/solr/pull/841#discussion_r867014000


##########
solr/core/src/test/org/apache/solr/cloud/TestLeaderElectionZkExpiry.java:
##########
@@ -16,39 +16,36 @@
  */
 package org.apache.solr.cloud;
 
-import com.carrotsearch.randomizedtesting.annotations.ThreadLeakLingering;
 import java.lang.invoke.MethodHandles;
 import java.nio.file.Path;
 import java.util.Collections;
+import java.util.concurrent.ExecutorService;
 import java.util.concurrent.TimeUnit;
-import org.apache.lucene.util.LuceneTestCase.BadApple;
 import org.apache.solr.SolrTestCaseJ4;
 import org.apache.solr.common.cloud.SolrZkClient;
+import org.apache.solr.common.util.ExecutorUtil;
+import org.apache.solr.common.util.SolrNamedThreadFactory;
+import org.apache.solr.common.util.TimeSource;
 import org.apache.solr.core.CloudConfig;
 import org.apache.solr.core.CoreContainer;
+import org.apache.solr.util.TimeOut;
 import org.apache.zookeeper.KeeperException;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-@ThreadLeakLingering(linger = 30)
-@BadApple(bugUrl = "https://issues.apache.org/jira/browse/SOLR-16122")

Review Comment:
   Love line 35!



-- 
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-unsubscribe@solr.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] risdenk merged pull request #841: SOLR-16046: Thread leak in TestLeaderElectionZkExpiry

Posted by GitBox <gi...@apache.org>.
risdenk merged PR #841:
URL: https://github.com/apache/solr/pull/841


-- 
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-unsubscribe@solr.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] HoustonPutman commented on pull request #841: SOLR-16046: Thread leak in TestLeaderElectionZkExpiry

Posted by GitBox <gi...@apache.org>.
HoustonPutman commented on PR #841:
URL: https://github.com/apache/solr/pull/841#issuecomment-1219019915

   Hey @risdenk should we still try and get this in?


-- 
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-unsubscribe@solr.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] magibney commented on pull request #841: SOLR-16046: Thread leak in TestLeaderElectionZkExpiry

Posted by GitBox <gi...@apache.org>.
magibney commented on PR #841:
URL: https://github.com/apache/solr/pull/841#issuecomment-1119873442

   LGTM. I was looking at SOLR-16046 as well and opened #842, which I think should complement this PR nicely.
   
   One thing I found myself wondering, wrt the `killer` thread as it exists on `main` at the moment (and as it has existed since its inception): why is it a separate thread at all?
   
   ```java
   Thread t = new Thread(() -> doStuff());
   t.start();
   t.join();
   ```
   ... why not just do?:
   ```java
   doStuff();
   ```
   It should execute in the same order, unless there's something "magical" about this being done from a different thread?
   


-- 
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-unsubscribe@solr.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] madrob commented on pull request #841: SOLR-16046: Thread leak in TestLeaderElectionZkExpiry

Posted by GitBox <gi...@apache.org>.
madrob commented on PR #841:
URL: https://github.com/apache/solr/pull/841#issuecomment-1119886878

   I'm glad you were looking at this. I had started some work on it locally on top of Houston's prior work (#690), that I just pushed up to https://github.com/madrob/solr/commits/zk-expiry-test so that we can compare notes. My tests were still failing though, IIRC with some new and exciting thread leaks and also some of the original ones that I couldn't reliably reproduce but would happen occasionally. So what you have is probably better. I'll pull your code down and try to run tests on it a few [hundred] times.


-- 
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-unsubscribe@solr.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org