Return-Path: Delivered-To: apmail-incubator-cxf-user-archive@locus.apache.org Received: (qmail 98824 invoked from network); 30 Nov 2007 21:20:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Nov 2007 21:20:38 -0000 Received: (qmail 84281 invoked by uid 500); 30 Nov 2007 21:20:25 -0000 Delivered-To: apmail-incubator-cxf-user-archive@incubator.apache.org Received: (qmail 84230 invoked by uid 500); 30 Nov 2007 21:20:25 -0000 Mailing-List: contact cxf-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-user@incubator.apache.org Delivered-To: mailing list cxf-user@incubator.apache.org Received: (qmail 84221 invoked by uid 99); 30 Nov 2007 21:20:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Nov 2007 13:20:25 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_HELO_PASS,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [64.79.197.59] (HELO mesa2.com) (64.79.197.59) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Nov 2007 21:20:24 +0000 Received: from [12.170.54.130] (account jdkulp HELO dilbert.boston.amer.iona.com) by mesa2.com (CommuniGate Pro SMTP 4.1.8) with ESMTP id 1539011; Fri, 30 Nov 2007 16:20:01 -0500 From: Daniel Kulp To: cxf-user@incubator.apache.org Subject: Re: Thread hangs when processing large response message using LocalTransport with dispatchDirect Date: Fri, 30 Nov 2007 16:20:00 -0500 User-Agent: KMail/1.9.7 Cc: mcoogan References: <14086696.post@talk.nabble.com> In-Reply-To: <14086696.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200711301620.00910.dkulp@apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Yea, that looks very bad. Pipes should NEVER be used on a single thread. That will definitely cause a hang. Can you log a JIRA? It probably should use a CachedOutputStream and then grab the inputstream in the dispatchDirect method. Dan On Friday 30 November 2007, mcoogan wrote: > I am running a local transport configured with DISPATCH_DIRECT = true. > Small request/response messages process successfully but any request > that generates a response > 1KB seems to hang the JVM. The problem > appears to be in the PipedInput/OutputStreams. If the buffer (default > size 1024B) fills up it is never flushed and the thread appears to > hang in an eternal wait (PipedInputStream.awaitSpace()) > > The PipedInput and PipedOutput Streams are on the same thread and > therefore the buffer is never cleared until after the stream is > closed. > > Has anyone else seen this problem or is it something I am missing in > the configuration. > > Here's a code snippet of how I send the local > > > InputStream in = null; > MyMessageObserver mo = new MyMessageObserver(); > > try { > EndpointInfo ei = new EndpointInfo(null, > "http://schemas.xmlsoap.org/soap/http"); > ei.setAddress(address); > > LocalConduit conduit = (LocalConduit)localTransport.getConduit(ei); > conduit.setMessageObserver(mo); > > Message msg = new MessageImpl(); > msg.put(LocalConduit.DIRECT_DISPATCH, true); > > in = new ByteArrayInputStream(messsageBytes); > msg.setContent(InputStream.class, in); > > conduit.close(msg); > return mo.getResponseStream().toByteArray(); > > } > finally { > > try { > if(in != null) { > in.close(); > } > } catch (Exception e) { > logger.error("Error closing Stream: "+ e.getMessage()); > } > } > > > Thanks in advance -- J. Daniel Kulp Principal Engineer IONA P: 781-902-8727 C: 508-380-7194 daniel.kulp@iona.com http://www.dankulp.com/blog