Return-Path: Delivered-To: apmail-servicemix-dev-archive@www.apache.org Received: (qmail 80400 invoked from network); 4 Feb 2010 16:29:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Feb 2010 16:29:55 -0000 Received: (qmail 26253 invoked by uid 500); 4 Feb 2010 16:29:54 -0000 Delivered-To: apmail-servicemix-dev-archive@servicemix.apache.org Received: (qmail 26196 invoked by uid 500); 4 Feb 2010 16:29:54 -0000 Mailing-List: contact dev-help@servicemix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@servicemix.apache.org Delivered-To: mailing list dev@servicemix.apache.org Received: (qmail 26185 invoked by uid 99); 4 Feb 2010 16:29:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Feb 2010 16:29:54 +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; Thu, 04 Feb 2010 16:29:53 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 895A0234C1EF for ; Thu, 4 Feb 2010 08:29:32 -0800 (PST) Message-ID: <1662315552.11151265300972557.JavaMail.jira@brutus.apache.org> Date: Thu, 4 Feb 2010 16:29:32 +0000 (UTC) From: "Ryan Moquin (JIRA)" To: dev@servicemix.apache.org Subject: [jira] Commented: (SM-1931) Threading problem in Servicemix-HTTP which renders the component unusable. In-Reply-To: <337617131.11141265298812552.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c [ https://issues.apache.org/activemq/browse/SM-1931?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=57385#action_57385 ] Ryan Moquin commented on SM-1931: --------------------------------- Also, here is the stack track that results when the isSTFlow is true: java.lang.Exception: HTTP request has timed out for exchange: ID:10.35.236.195-126973cb3fe-6:16 at org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.process(HttpConsumerEndpoint.java:244) at org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:627) at org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:598) at org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:535) at org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60) at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:623) at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172) at org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168) at org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) ERROR - HttpComponent - Error setting exchange status to ERROR java.lang.IllegalStateException: component is not owner when trying to set error: java.lang.Exception: HTTP reques t has timed out for exchange: ID:10.35.236.195-126973cb3fe-6:16 at org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setError(MessageExchangeImpl.java:264) at org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:550) at org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60) at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:623) at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172) at org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168) at org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.Exception: HTTP request has timed out for exchange: ID:10.35.236.195-126973cb3fe-6:16 at org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.process(HttpConsumerEndpoint.java:244) at org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:627) at org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:598) at org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:535) ... 8 more Basically the request supposedly timed out (even though it hasn't) because the isSTFlow caused the exchange to be removed after the exchange was dispatched to the target service. > Threading problem in Servicemix-HTTP which renders the component unusable. > -------------------------------------------------------------------------- > > Key: SM-1931 > URL: https://issues.apache.org/activemq/browse/SM-1931 > Project: ServiceMix > Issue Type: Bug > Components: servicemix-http > Affects Versions: 3.3.1 > Environment: Windows XP, servicemix-http component 2009.02 > Reporter: Ryan Moquin > Priority: Blocker > > In most of the servicemix-http component versions, including the latest, there is a variable called isSTFlow which is a class variable. This variable appears to be shared among all threads that access a deployed servicemix-http component. The problem with this is that isSTFlow is set by a certain request based upon the state of it's continuation when the exchange response is processed here: > if (!cont.isPending()) { > isSTFlow = true; > System.out.println("isSTFlow set to true because continuation isn't pending."); > } else { > isSTFlow = false; > System.out.println("isSTFlow set to false because continuation is pending."); > If isSTFlow is set to true during that response.. all future requests that come in will then end up executing this code block on line 348: > } else { > String id = (String)request.getAttribute(MessageExchange.class.getName()); > System.out.println("STFlow was true, removing exchange with id: " + id); > locks.remove(id); > exchange = exchanges.remove(id); > request.removeAttribute(MessageExchange.class.getName()); > } > before the exchange associated with the request has had a chance to return. Once that exchange has returned, it can't be found, because it was removed and throws a timeout error. Once isSTFlow becomes true, the component hits a race condition where it checks isSTFlow for true before the async call has a chance to return and immediately times out the exchange. This variable needs to be localized for each specific request, not global to all requests. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.