[
https://issues.apache.org/jira/browse/CASSANDRA-16228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17221914#comment-17221914
]
Ekaterina Dimitrova commented on CASSANDRA-16228:
-------------------------------------------------
The CI results are out. The only failure that grabbed my attention was the one
of [test_table_metric_mbeans - jmx_test.TestJMX |
https://app.circleci.com/pipelines/github/ekaterinadimitrova2/cassandra/450/workflows/8df700c5-1775-433f-8dfc-3b3391f3d0ae/jobs/2606]
.
But it looks like it was random, unrelated, CircleCI resource related(I also
looped the test locally several times and it completed successfully):
{code:java}
stdout = b"Couldn't start agent for PID 6894\nPossible reason could be that
port '8778' is already occupied.\nPlease check the standard output of the
target process for a detailed error message.\n"
{code}
> Fix race condition on ColumnFamilyStore and TableMetrics initialization that
> makes MetricListener to see an instance in an unknown state
> ----------------------------------------------------------------------------------------------------------------------------------------
>
> Key: CASSANDRA-16228
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16228
> Project: Cassandra
> Issue Type: Bug
> Components: Observability/Metrics
> Reporter: Ekaterina Dimitrova
> Assignee: Ekaterina Dimitrova
> Priority: Normal
> Fix For: 3.0.x, 3.11.x, 4.0-beta
>
>
> There is a dependency between TableMetrics, SecondaryIndexManager and Tracker
> which requires certain order of the operations in ColumnFamilyStore
> constructor.
> The following test will be added to ColumnFamilyMetricTest to show the issue:
> {code:java}
> @Test
> public void testStartupRaceConditionOnMetricListeners()
> {
> // Since the ColumnFamilyStore instance reference escapes during the
> construction
> // we have a race condition and listeners can see an instance that is in an
> unknown state.
> // This test just check that all callbacks can access the data without
> throwing any exception.
> registerMetricListener();
> SchemaLoader.createKeyspace("Keyspace2",
> KeyspaceParams.simple(1),
> SchemaLoader.standardCFMD("Keyspace2", "Standard2"));
> }
> private void registerMetricListener()
> {
> CassandraMetricsRegistry.Metrics.addListener(new
> MetricRegistryListener.Base()
> {
> @Override
> public void onGaugeAdded(String name, Gauge<?> gauge)
> {
> gauge.getValue();
> }
> @Override
> public void onGaugeRemoved(String name)
> {
> }
> @Override
> public void onCounterAdded(String name, Counter counter)
> {
> counter.getCount();
> }
> @Override
> public void onCounterRemoved(String name)
> {
> }
> @Override
> public void onHistogramAdded(String name, Histogram histogram)
> {
> histogram.getCount();
> }
> @Override
> public void onHistogramRemoved(String name)
> {
> }
> @Override
> public void onMeterAdded(String name, Meter meter)
> {
> meter.getCount();
> }
> @Override
> public void onMeterRemoved(String name)
> {
> }
> @Override
> public void onTimerAdded(String name, Timer timer)
> {
> timer.getCount();
> }
> @Override
> public void onTimerRemoved(String name)
> {
> }
> });{code}
> *NOTE:* In order to be able to run the test and use registerMetricListener()
> method a small modification to requests in CacheMetrics is needed. This will
> be submitted and further explained with a coming patch.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]