[
https://issues.apache.org/jira/browse/CASSANDRA-15958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17187866#comment-17187866
]
Yifan Cai commented on CASSANDRA-15958:
---------------------------------------
Hi Adam. Yes. I agree with option 1.
IMO, the periodic prune task and the condition to guard entering the actual
prune operation is a best effort optimization to reduce the messages in the
outbound queue.
The contention for the lock (between poll and prune) would be increased, if
removing the condition. The periodic prune task will try to acquire the lock
every time it is triggered (every 100 ms). Prune is an O(n) operation. It could
become expensive when the outbound queue is large and block the poll more
likely. So having a condition to guard the entry makes sense to me, even though
the condition could become inaccurate (, best effort). The exact impact on the
queue performance need to be benchmarked. Intuitively, I think having the guard
provides benefit.
> org.apache.cassandra.net.ConnectionTest testMessagePurging
> ----------------------------------------------------------
>
> Key: CASSANDRA-15958
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15958
> Project: Cassandra
> Issue Type: Bug
> Components: Test/unit
> Reporter: David Capwell
> Assignee: Adam Holmberg
> Priority: Normal
> Fix For: 4.0-beta
>
>
> Build:
> https://ci-cassandra.apache.org/job/Cassandra-trunk-test/196/testReport/junit/org.apache.cassandra.net/ConnectionTest/testMessagePurging/
> Build:
> https://ci-cassandra.apache.org/job/Cassandra-trunk-test/194/testReport/junit/org.apache.cassandra.net/ConnectionTest/testMessagePurging/
> java.util.concurrent.TimeoutException
> at org.apache.cassandra.net.AsyncPromise.get(AsyncPromise.java:258)
> at org.apache.cassandra.net.FutureDelegate.get(FutureDelegate.java:143)
> at
> org.apache.cassandra.net.ConnectionTest.doTestManual(ConnectionTest.java:268)
> at
> org.apache.cassandra.net.ConnectionTest.testManual(ConnectionTest.java:236)
> at
> org.apache.cassandra.net.ConnectionTest.testMessagePurging(ConnectionTest.java:679)
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]