netudima commented on code in PR #4624:
URL: https://github.com/apache/cassandra/pull/4624#discussion_r2823587313
##########
test/unit/org/apache/cassandra/net/MatcherResponse.java:
##########
@@ -39,6 +41,8 @@
*/
public class MatcherResponse
{
+ // destroyed by finalizer
Review Comment:
hm, it has (at least in my JDK versions).
java.util.concurrent.Executors#newSingleThreadExecutor()
```
public static ExecutorService newSingleThreadExecutor() {
return new FinalizableDelegatedExecutorService
(new ThreadPoolExecutor(1, 1,
0L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<Runnable>()));
}
...
private static class FinalizableDelegatedExecutorService
extends DelegatedExecutorService {
FinalizableDelegatedExecutorService(ExecutorService executor) {
super(executor);
}
@SuppressWarnings("deprecation")
protected void finalize() {
super.shutdown();
}
}
```
but I agree, it is probably too fragile to rely on it. Let me try to change
it to explicit lifecycle approach. Hopefully we do not have too many tests I
have to change due to lack of lifecycle in the current MockMessagingSpy logic.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]