Return-Path: X-Original-To: apmail-tomcat-dev-archive@www.apache.org Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AC8C4DF11 for ; Thu, 1 Nov 2012 13:32:58 +0000 (UTC) Received: (qmail 82341 invoked by uid 500); 1 Nov 2012 13:32:58 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 82146 invoked by uid 500); 1 Nov 2012 13:32:57 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 82098 invoked by uid 99); 1 Nov 2012 13:32:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Nov 2012 13:32:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.115] (HELO eir.zones.apache.org) (140.211.11.115) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Nov 2012 13:32:52 +0000 Received: by eir.zones.apache.org (Postfix, from userid 80) id EAB0BA371; Thu, 1 Nov 2012 13:32:30 +0000 (UTC) From: bugzilla@apache.org To: dev@tomcat.apache.org Subject: [Bug 54086] New: ConcurrentModificationException in NioReceiver on shutdown Date: Thu, 01 Nov 2012 13:32:28 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Tomcat 7 X-Bugzilla-Component: Cluster X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: clucas@e-miles.com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: dev@tomcat.apache.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: priority bug_id assigned_to short_desc bug_severity classification op_sys reporter rep_platform bug_status version component product Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://issues.apache.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org https://issues.apache.org/bugzilla/show_bug.cgi?id=3D54086 Priority: P2 Bug ID: 54086 Assignee: dev@tomcat.apache.org Summary: ConcurrentModificationException in NioReceiver on shutdown Severity: normal Classification: Unclassified OS: Solaris Reporter: clucas@e-miles.com Hardware: Sun Status: NEW Version: 7.0.30 Component: Cluster Product: Tomcat 7 Solaris 10 x86, jdk 1.7. We use tomcat clustering for session replication with 4 nodes and sometimes= 8 nodes. We get a ConcurrentModificationException occasionally on shutdown. = I have been unable to reliably reproduce the exception. In the log, I see "Un= able to close cluster receiver selector." with the exception below: java.util.ConcurrentModificationException=20 java.util.HashMap$HashIterator.nextEntry(HashMap.java:894)=20 java.util.HashMap$KeyIterator.next(HashMap.java:928)=20 java.util.Collections$UnmodifiableCollection$1.next(Collections.java:10= 67)=20 =20=20=20 org.=E2=80=8Bapache.=E2=80=8Bcatalina.=E2=80=8Btribes.=E2=80=8Btransport.= =E2=80=8Bnio.=E2=80=8BNioReceiver.=E2=80=8BcloseSelector(=E2=80=8BNioReceiv= er.=E2=80=8Bjava:382)=20 =20=20=20 org.=E2=80=8Bapache.=E2=80=8Bcatalina.=E2=80=8Btribes.=E2=80=8Btransport.= =E2=80=8Bnio.=E2=80=8BNioReceiver.=E2=80=8BstopListening(=E2=80=8BNioReceiv= er.=E2=80=8Bjava:365)=20 =20=20=20 org.apache.catalina.tribes.transport.nio.NioReceiver.stop(NioReceiver.java:= 86)=20 =20=20=20 org.=E2=80=8Bapache.=E2=80=8Bcatalina.=E2=80=8Btribes.=E2=80=8Bgroup.=E2=80= =8BChannelCoordinator.=E2=80=8BinternalStop(=E2=80=8BChannelCoordinator.jav= a:203)=20 =20=20=20 org.=E2=80=8Bapache.=E2=80=8Bcatalina.=E2=80=8Btribes.=E2=80=8Bgroup.=E2=80= =8BChannelCoordinator.=E2=80=8Bstop(=E2=80=8BChannelCoordinator.=E2=80=8Bja= va:115)=20 =20=20=20 org.=E2=80=8Bapache.=E2=80=8Bcatalina.=E2=80=8Btribes.=E2=80=8Bgroup.=E2=80= =8BChannelInterceptorBase.=E2=80=8Bstop(=E2=80=8BChannelInterceptorBase.jav= a:178)=20 =20=20=20 org.=E2=80=8Bapache.=E2=80=8Bcatalina.=E2=80=8Btribes.=E2=80=8Bgroup.=E2=80= =8BChannelInterceptorBase.=E2=80=8Bstop(=E2=80=8BChannelInterceptorBase.jav= a:178)=20 =20=20=20 org.=E2=80=8Bapache.=E2=80=8Bcatalina.=E2=80=8Btribes.=E2=80=8Bgroup.=E2=80= =8BChannelInterceptorBase.=E2=80=8Bstop(=E2=80=8BChannelInterceptorBase.jav= a:178)=20 =20=20=20 org.=E2=80=8Bapache.=E2=80=8Bcatalina.=E2=80=8Btribes.=E2=80=8Bgroup.=E2=80= =8Binterceptors.=E2=80=8BMessageDispatchInterceptor.=E2=80=8Bstop(=E2=80=8B= MessageDispatchInterceptor.java:172) =20=20=20 org.=E2=80=8Bapache.=E2=80=8Bcatalina.=E2=80=8Btribes.=E2=80=8Bgroup.=E2=80= =8BChannelInterceptorBase.=E2=80=8Bstop(=E2=80=8BChannelInterceptorBase.jav= a:178)=20 =20=20=20 org.=E2=80=8Bapache.=E2=80=8Bcatalina.=E2=80=8Btribes.=E2=80=8Bgroup.=E2=80= =8BChannelInterceptorBase.=E2=80=8Bstop(=E2=80=8BChannelInterceptorBase.jav= a:178)=20 org.apache.catalina.tribes.group.GroupChannel.stop(GroupChannel.java:43= 8)=20 =20=20=20 org.=E2=80=8Bapache.=E2=80=8Bcatalina.=E2=80=8Bha.=E2=80=8Btcp.=E2=80=8BSim= pleTcpCluster.=E2=80=8BstopInternal(=E2=80=8BSimpleTcpCluster.=E2=80=8Bjava= :=E2=80=8B744)=20 org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)=20 =20=20=20 org.apache.catalina.core.ContainerBase.stopInternal(ContainerBase.java:1199= )=20 org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)=20 =20=20=20 org.apache.catalina.core.StandardService.stopInternal(StandardService.java:= 502)=20 org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)=20 =20=20=20 org.apache.catalina.core.StandardServer.stopInternal(StandardServer.java:75= 3)=20 org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)=20 org.apache.catalina.startup.Catalina.stop(Catalina.java:751)=20 org.apache.catalina.startup.Catalina.start(Catalina.java:713)=20 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)=20 =20=20=20 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:5= 7)=20 =20=20=20 sun.=E2=80=8Breflect.=E2=80=8BDelegatingMethodAccessorImpl.=E2=80=8Binvoke(= =E2=80=8BDelegatingMethodAccessorImpl.=E2=80=8Bjava:43)=20 java.lang.reflect.Method.invoke(Method.java:601)=20 org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)=20 org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:451) I looked at the code briefly and noticed the use of a SelectionKey Iterator= . I have not dug deep enough to find any issue in the NioReceiver code, but I d= id find this potentially relevant text in the Selector javadocs (http://docs.oracle.com/javase/7/docs/api/java/nio/channels/Selector.html): "A selector's key and selected-key sets are not, in general, safe for use by multiple concurrent threads. If such a thread might modify one of these sets directly then access should be controlled by synchronizing on the set itsel= f. The iterators returned by these sets' iterator methods are fail-fast: If the set is modified after the iterator is created, in any way except by invoking the iterator's own remove method, then a ConcurrentModificationException wi= ll be thrown." --=20 You are receiving this mail because: You are the assignee for the bug.= --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org