dcapwell commented on code in PR #65:
URL: https://github.com/apache/cassandra-accord/pull/65#discussion_r1323364390
##########
accord-core/src/main/java/accord/utils/async/AsyncChains.java:
##########
@@ -363,6 +477,11 @@ protected void checkNextIsHead()
Invariants.checkState(next instanceof Head<?>, "Next is not an
instance of AsyncChains.Head (it is %s); was map/flatMap called on the same
object multiple times?", next.getClass());
}
+ public static AsyncChain<?> detectLeak(Consumer<Throwable> onLeak,
Runnable onCall)
Review Comment:
> WDYT about adding a flag to include this in every chain that can be used
in testing?
I currently use `accord.utils.Invariants#isParanoid` in
`accord.impl.basic.DelayedCommandStores.DelayedCommandStore#submit(java.util.concurrent.Callable<T>)`,
so `CommandStore` leaks should be detected. Are there other places you are
thinking about? We have `accord.utils.async.AsyncChains.Head` but that feels
tricky as we use `extends`, so would need a costly `finalize` or a big refactor
to move away from `Head` directly.
--
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]