Return-Path: Delivered-To: apmail-jakarta-httpcomponents-dev-archive@www.apache.org Received: (qmail 71269 invoked from network); 23 Nov 2007 08:43:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Nov 2007 08:43:07 -0000 Received: (qmail 30035 invoked by uid 500); 23 Nov 2007 08:42:54 -0000 Delivered-To: apmail-jakarta-httpcomponents-dev-archive@jakarta.apache.org Received: (qmail 30005 invoked by uid 500); 23 Nov 2007 08:42:54 -0000 Mailing-List: contact httpcomponents-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list httpcomponents-dev@jakarta.apache.org Received: (qmail 29993 invoked by uid 99); 23 Nov 2007 08:42:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Nov 2007 00:42:54 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Nov 2007 08:43:04 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 54D0171420E for ; Fri, 23 Nov 2007 00:42:43 -0800 (PST) Message-ID: <29572727.1195807363343.JavaMail.jira@brutus> Date: Fri, 23 Nov 2007 00:42:43 -0800 (PST) From: "Oleg Kalnichevski (JIRA)" To: httpcomponents-dev@jakarta.apache.org Subject: [jira] Resolved: (HTTPCORE-130) Potential for deadlock while using a ThrottlingHttpServiceHandler and a SSLIOSession In-Reply-To: <1109873.1195733983035.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HTTPCORE-130?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Oleg Kalnichevski resolved HTTPCORE-130. ---------------------------------------- Resolution: Fixed Lorenzo I believe I have found and eliminated the cause of the problem. Could you please re-test your application against the latest SVN snapshot and confirm the fix? If the problem persists, please re-open this issue. Many thanks for reporting the bug and submitting a very precise and detailed description of it. Oleg > Potential for deadlock while using a ThrottlingHttpServiceHandler and a SSLIOSession > ------------------------------------------------------------------------------------ > > Key: HTTPCORE-130 > URL: https://issues.apache.org/jira/browse/HTTPCORE-130 > Project: HttpComponents Core > Issue Type: Bug > Components: HttpCore > Affects Versions: 4.0-alpha6 > Environment: Linux RHEL 4, jdk 1.6_02 > Reporter: Lorenzo Moretti > Assignee: Oleg Kalnichevski > Fix For: 4.0-beta1 > > > The following message was originally posted under HTTPCORE-48 but Oleg asked to created a new issue for it. > I have been working with HttpCore alpha 6 for the past weeks and recently ran into a deadlock. Since I am quite new to both NIO and SSL it might very well be that the code for my tests is inappropriate. I obtained the following deadlock stack trace using "kill -QUIT" on the process. > After the deadlock description I have very briefly explained what my test methods do. I am not sure they are relevant since they do not do any locking themselves, but *that* in itself might be the source of the problem! :) > Object <0x8c65a988>, if I am not mistaken, is the SharedInputBuffer.mutex. > Thread "RequestWorker_12" was spawned within ThrottlingHttpServiceHandler.handleRequest() by this.executor.execute(). > Thread "TestService_IOD_11" was spawned within AbstractMultiworkerIOReactor.execute() by this.threadFactory.newThread() > ============================= > "RequestWorker_12": > waiting to lock monitor 0x08083ac8 (object 0x8c61cd18, a org.apache.http.impl.nio.reactor.SSLIOSession), > which is held by "TestService_IOD_11" > "TestService_IOD_11": > waiting to lock monitor 0x08083a64 (object 0x8c65a988, a java.lang.Object), > which is held by "RequestWorker_12" > Java stack information for the threads listed above: > =================================================== > "RequestWorker_12": > at org.apache.http.impl.nio.reactor.SSLIOSession.setEvent(SSLIOSession.java:371) > - waiting to lock <0x8c61cd18> (a org.apache.http.impl.nio.reactor.SSLIOSession) > at org.apache.http.impl.nio.NHttpConnectionBase.requestInput(NHttpConnectionBase.java:154) > at org.apache.http.nio.util.SharedInputBuffer.waitForData(SharedInputBuffer.java:104) > - locked <0x8c65a988> (a java.lang.Object) > at org.apache.http.nio.util.SharedInputBuffer.read(SharedInputBuffer.java:137) > - locked <0x8c65a988> (a java.lang.Object) > at org.apache.http.nio.entity.ContentInputStream.read(ContentInputStream.java:63) > at TestHttpServer.readData(TestHttpServer.java:451) > at TestHttpServer.access$200(TestHttpServer.java:62) > at TestHttpServer$TestHandler3.handle(TestHttpServer.java:312) > at org.apache.http.nio.protocol.ThrottlingHttpServiceHandler.handleRequest(ThrottlingHttpServiceHandler.java:477) > at org.apache.http.nio.protocol.ThrottlingHttpServiceHandler.access$000(ThrottlingHttpServiceHandler.java:91) > at org.apache.http.nio.protocol.ThrottlingHttpServiceHandler$1.run(ThrottlingHttpServiceHandler.java:195) > at java.lang.Thread.run(Thread.java:619) > at DefaultRequestExecutor$Worker.run(DefaultRequestExecutor.java:43) > "TestService_IOD_11": > at org.apache.http.nio.util.SharedInputBuffer.consumeContent(SharedInputBuffer.java:71) > - waiting to lock <0x8c65a988> (a java.lang.Object) > at org.apache.http.nio.protocol.ThrottlingHttpServiceHandler.inputReady(ThrottlingHttpServiceHandler.java:227) > - locked <0x8c658408> (a org.apache.http.nio.protocol.ThrottlingHttpServiceHandler$ServerConnState) > at org.apache.http.impl.nio.DefaultNHttpServerConnection.consumeInput(DefaultNHttpServerConnection.java:135) > at org.apache.http.impl.nio.reactor.SSLServerIOEventDispatch.inputReady(SSLServerIOEventDispatch.java:132) > - locked <0x8c61cd18> (a org.apache.http.impl.nio.reactor.SSLIOSession) > at IoEventDispatchWrapper.inputReady(IoEventDispatchWrapper.java:45) > at org.apache.http.impl.nio.reactor.BaseIOReactor.validate(BaseIOReactor.java:137) > at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:141) > at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:69) > at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:281) > at DebugThreadFactory$1.run(DebugThreadFactory.java:29) > at java.lang.Thread.run(Thread.java:619) > Found 1 deadlock. > RequestWorker_12 uses: > * DefaultRequestExecutor$Worker.run(): runs the Runnable created by ThrottlingHttpServiceHandler.requestReceived(). > * TestHttpServer$TestHandler3.handle(): acts as an echo by setting the response body with the contents of the request body (status is set to SC_OK). > * TestHttpServer.readData(): transfers bytes from an HttpEntityEnclosingRequest.getEntity().getContent() to a ByteArrayOutputStream. > DebugThreadFactory$1is a dynamically created Thread based on the Runnable passed to ThreadFactory.newThread(). > TestService_IOD_11 uses: > * DebugThreadFactory$1.run(): sets logging information before invoking Runnable.run(). > * IoEventDispatchWrapper.inputReady(): invokes the IOEventDispatch.inputReady() for the dispatch it wraps. > Thanks for your time, > -- Lorenzo -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org