cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Brown (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-7177) Starting threads in the OutboundTcpConnectionPool constructor causes race conditions
Date Tue, 06 May 2014 22:12:15 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-7177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13991223#comment-13991223
] 

Jason Brown commented on CASSANDRA-7177:
----------------------------------------

While I do see the comment in the CDL javadoc now ("This method is typically used for debugging
and testing purposes"), if you look at the implementation of ASQ.tryAcquireSharedNanos(),
it's not entirely free nor "returns straight away" as two native calls are made. However,
I'm not wedded to the micro-optimization, and can commit either way.

> Starting threads in the OutboundTcpConnectionPool constructor causes race conditions
> ------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-7177
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7177
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>            Reporter: Sergio Bossa
>            Assignee: Sergio Bossa
>         Attachments: CASSANDRA-7177.patch
>
>
> The OutboundTcpConnectionPool starts connection threads in its constructor, causing race
conditions when MessagingService#getConnectionPool is concurrently called for the first time
for a given address.
> I.e., here's one of the races:
> {noformat}
>  WARN 12:49:03,182 Error processing org.apache.cassandra.metrics:type=Connection,scope=127.0.0.1,name=CommandPendingTasks
> javax.management.InstanceAlreadyExistsException: org.apache.cassandra.metrics:type=Connection,scope=127.0.0.1,name=CommandPendingTasks
> 	at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:437)
> 	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerWithRepository(DefaultMBeanServerInterceptor.java:1898)
> 	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:966)
> 	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:900)
> 	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:324)
> 	at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)
> 	at com.yammer.metrics.reporting.JmxReporter.registerBean(JmxReporter.java:464)
> 	at com.yammer.metrics.reporting.JmxReporter.processGauge(JmxReporter.java:438)
> 	at com.yammer.metrics.reporting.JmxReporter.processGauge(JmxReporter.java:16)
> 	at com.yammer.metrics.core.Gauge.processWith(Gauge.java:28)
> 	at com.yammer.metrics.reporting.JmxReporter.onMetricAdded(JmxReporter.java:395)
> 	at com.yammer.metrics.core.MetricsRegistry.notifyMetricAdded(MetricsRegistry.java:516)
> 	at com.yammer.metrics.core.MetricsRegistry.getOrAdd(MetricsRegistry.java:491)
> 	at com.yammer.metrics.core.MetricsRegistry.newGauge(MetricsRegistry.java:79)
> 	at com.yammer.metrics.Metrics.newGauge(Metrics.java:70)
> 	at org.apache.cassandra.metrics.ConnectionMetrics.<init>(ConnectionMetrics.java:71)
> 	at org.apache.cassandra.net.OutboundTcpConnectionPool.<init>(OutboundTcpConnectionPool.java:55)
> 	at org.apache.cassandra.net.MessagingService.getConnectionPool(MessagingService.java:498)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message