Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 38790 invoked from network); 24 Apr 2007 21:43:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Apr 2007 21:43:55 -0000 Received: (qmail 59394 invoked by uid 500); 24 Apr 2007 21:44:02 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 59265 invoked by uid 500); 24 Apr 2007 21:44:02 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 59256 invoked by uid 99); 24 Apr 2007 21:44:02 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Apr 2007 14:44:02 -0700 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; Tue, 24 Apr 2007 14:43:54 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 76482714047 for ; Tue, 24 Apr 2007 14:43:34 -0700 (PDT) Message-ID: <10397644.1177451014479.JavaMail.jira@brutus> Date: Tue, 24 Apr 2007 14:43:34 -0700 (PDT) From: "Alex Burgel (JIRA)" To: dev@activemq.apache.org Subject: [jira] Updated: (AMQ-1235) Scheduler.cancel uses incorrect argument to shutdown threads In-Reply-To: <32605011.1177419814480.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/AMQ-1235?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alex Burgel updated AMQ-1235: ----------------------------- Attachment: scheduler.patch here's a patch. > Scheduler.cancel uses incorrect argument to shutdown threads > ------------------------------------------------------------ > > Key: AMQ-1235 > URL: https://issues.apache.org/activemq/browse/AMQ-1235 > Project: ActiveMQ > Issue Type: Bug > Affects Versions: 4.1.1 > Reporter: Alex Burgel > Priority: Critical > Attachments: scheduler.patch > > > looking at the code from 4.1.1 in org.apache.activemq.thread.Scheduler, in the cancel method: > the Runnable task argument is passed to clockDaemon.remove(). i think this is incorrect. ScheduledFuture ticket should be passed to clockDaemon.remove(). > the javadocs of ScheduledThreadPoolExecutor.remove discuss the possibility that Runnables might be stored in some other form internally, so calling remove with a plain Runnable might not do anything. I think the solution is to call remove with a ScheduledFuture, which is how they are stored internally in ScheduledThreadPoolExecutor. > i came across this bug after upgrading to the java 5 version of backport-util-concurrent 3.0. that version makes more assumptions about the types that are passed into ScheduledThreadPoolExecutor.remove, so when you pass in a regular Runnable you'll get a ClassCastException. > this is trivial to fix, so i don't think a patch is necessary. also i think this might address the memory leak mentioned in AMQ-1205 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.