Return-Path: Delivered-To: apmail-camel-dev-archive@www.apache.org Received: (qmail 17637 invoked from network); 13 Oct 2010 12:22:10 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Oct 2010 12:22:10 -0000 Received: (qmail 66401 invoked by uid 500); 13 Oct 2010 12:22:10 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 66260 invoked by uid 500); 13 Oct 2010 12:22:08 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 66252 invoked by uid 99); 13 Oct 2010 12:22:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Oct 2010 12:22:07 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of willem.jiang@gmail.com designates 74.125.83.173 as permitted sender) Received: from [74.125.83.173] (HELO mail-pv0-f173.google.com) (74.125.83.173) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Oct 2010 12:22:02 +0000 Received: by pvc21 with SMTP id 21so145647pvc.32 for ; Wed, 13 Oct 2010 05:21:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=ZNzhDyRyIRdHybgs0GnXT/SwmuDSZ1rxbw1ggP/UQsY=; b=blantWGGSm5NfZAOKQPiDE7/H1HBB+w1kY/AX2wZO7WZNSPQrLaLDiti3aRK4SU335 rdstNEeV04OJEKuFXwzIsTWmueHh2gR2M+v5Bn//tSir8606GvxOQtMmT6NjQ2Hfzf+A l4sWMvWEhD/AO8ADIP0uRuBIjmNqxVIFo4dDY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=vp7NE1s+s74XydJ/6yb8uVvJ/14sZaf6AryqIvduBh8vONZRbfgQ0MJEk6IOwQuiPs mWOehfmV9BdKZ+SneNx7kJQHAoa2UgpRJNkdgIZtMwJr7SIhTrXbCbdxkQblgT3gpBFB E0DthRIvYVROTzLtn+/wq8k2CYX7OGnHQnW50= Received: by 10.142.164.7 with SMTP id m7mr7428191wfe.105.1286972501976; Wed, 13 Oct 2010 05:21:41 -0700 (PDT) Received: from [192.168.0.158] ([125.33.127.247]) by mx.google.com with ESMTPS id t38sm11325140wfc.21.2010.10.13.05.21.36 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 13 Oct 2010 05:21:41 -0700 (PDT) Message-ID: <4CB5A44B.9090601@gmail.com> Date: Wed, 13 Oct 2010 20:21:31 +0800 From: Willem Jiang User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.9) Gecko/20100915 Lightning/1.0b2 Thunderbird/3.1.4 MIME-Version: 1.0 To: dev@camel.apache.org Subject: Re: svn commit: r1022017 - /camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExecutorServiceStrategy.java References: <20101013075310.2207E238890B@eris.apache.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit OK, I will change the code to throw the IllegalArguementException for this case. On 10/13/10 7:58 PM, Claus Ibsen wrote: > Hi > > This is rather ugly to silently change 0 to 1 without end user noticing. > Instead lets thrown an IllegalArgumentException and require core pool > size to be 1 or higher. > > Then in Camel 3 we can allow a core size of 0. Which the thread pool > in JDK 1.6 seems to accept better than 1.5. > > > On Wed, Oct 13, 2010 at 9:53 AM, wrote: >> Author: ningjiang >> Date: Wed Oct 13 07:53:09 2010 >> New Revision: 1022017 >> >> URL: http://svn.apache.org/viewvc?rev=1022017&view=rev >> Log: >> CAMEL-3220 try to fix the test hang of ThreadsZeroInCoreAndMaxPoolTest >> >> Modified: >> camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExecutorServiceStrategy.java >> >> Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExecutorServiceStrategy.java >> URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExecutorServiceStrategy.java?rev=1022017&r1=1022016&r2=1022017&view=diff >> ============================================================================== >> --- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExecutorServiceStrategy.java (original) >> +++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExecutorServiceStrategy.java Wed Oct 13 07:53:09 2010 >> @@ -269,7 +269,13 @@ public class DefaultExecutorServiceStrat >> >> // the thread name must not be null >> ObjectHelper.notNull(name, "ThreadName"); >> - >> + >> + // If we set the corePoolSize to be 0, the whole camel application will hang in JDK5 >> + // just add a check here to set the corePoolSize to be 1 >> + if (corePoolSize == 0) { >> + corePoolSize = 1; >> + } >> + >> ExecutorService answer = ExecutorServiceHelper.newThreadPool(threadNamePattern, name, corePoolSize, maxPoolSize, keepAliveTime, >> timeUnit, maxQueueSize, rejectedExecutionHandler, daemon); >> onThreadPoolCreated(answer); >> >> >> > > > -- Willem ---------------------------------- Open Source Integration: http://www.fusesource.com Blog: http://willemjiang.blogspot.com (English) http://jnn.javaeye.com (Chinese) Twitter: http://twitter.com/willemjiang