Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 88463 invoked from network); 1 Jun 2009 16:12:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Jun 2009 16:12:03 -0000 Received: (qmail 28193 invoked by uid 500); 1 Jun 2009 16:12:15 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 28139 invoked by uid 500); 1 Jun 2009 16:12:15 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 28129 invoked by uid 99); 1 Jun 2009 16:12:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jun 2009 16:12:15 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jun 2009 16:12:12 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 6B2E4234C004 for ; Mon, 1 Jun 2009 09:11:51 -0700 (PDT) Message-ID: <1006742364.1243872711433.JavaMail.jira@brutus> Date: Mon, 1 Jun 2009 09:11:51 -0700 (PDT) From: "Dave Stanley (JIRA)" To: dev@activemq.apache.org Subject: [jira] Created: (AMQ-2277) NIO SelectorWorker not protecting its Selector from mutable operations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c X-Virus-Checked: Checked by ClamAV on apache.org NIO SelectorWorker not protecting its Selector from mutable operations ---------------------------------------------------------------------- Key: AMQ-2277 URL: https://issues.apache.org/activemq/browse/AMQ-2277 Project: ActiveMQ Issue Type: Bug Components: Broker Affects Versions: 5.2.0 Environment: 5.2.x, trunk. Problem seen on Linux and Solaris. Reporter: Dave Stanley Attachments: nio_patch.txt When you hit the NIO transport with heavy concurrent connection load the brokers thread usage spikes with lots of threads in the state below. "ActiveMQ Transport Initiator: /10.129.112.166:59560" daemon prio=10 tid=0x007a2fc0 nid=0x34b waiting for monitor entry [0xc4381000..0xc4381888] at org.apache.activemq.transport.nio.SelectorManager.register(SelectorManager.java:65) - waiting to lock <0xd8b1d920> (a org.apache.activemq.transport.nio.SelectorManager) at org.apache.activemq.transport.nio.NIOTransport.initializeStreams(NIOTransport.java:66) at org.apache.activemq.transport.tcp.TcpTransport.connect(TcpTransport.java:453) at org.apache.activemq.transport.nio.NIOTransport.doStart(NIOTransport.java:146) at org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:53) at org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:57) at org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:57) at org.apache.activemq.transport.WireFormatNegotiator.start(WireFormatNegotiator.java:72) at org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:57) at org.apache.activemq.broker.TransportConnection.start(TransportConnection.java:880) - locked <0xdb727578> (a org.apache.activemq.broker.jmx.ManagedTransportConnection) at org.apache.activemq.broker.TransportConnector$1$1.run(TransportConnector.java:213) Problem is easily reproducible when consumer/producer are on a different machine to the broker - when running everything locally .. not so much. It seems the SelectorWorker is not tolerant of lots of concurrent updates to the state of the Selector, and the selector gets into a bad state. Attached patch seems to resolve the issue. Patch adds some locking around when selectorKeys are registered and canceled. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.