From issues-return-66207-archive-asf-public=cust-asf.ponee.io@commons.apache.org Tue Jan 30 12:50:04 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 5376718061A for ; Tue, 30 Jan 2018 12:50:04 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 4306A160C54; Tue, 30 Jan 2018 11:50:04 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8DE91160C42 for ; Tue, 30 Jan 2018 12:50:03 +0100 (CET) Received: (qmail 63397 invoked by uid 500); 30 Jan 2018 11:50:02 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 63386 invoked by uid 99); 30 Jan 2018 11:50:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Jan 2018 11:50:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 1FF4AD2D21 for ; Tue, 30 Jan 2018 11:50:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.311 X-Spam-Level: X-Spam-Status: No, score=-110.311 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id fIYwJCHPl08f for ; Tue, 30 Jan 2018 11:50:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 10C5C5F19D for ; Tue, 30 Jan 2018 11:50:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 4E841E00D2 for ; Tue, 30 Jan 2018 11:50:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 0578C21301 for ; Tue, 30 Jan 2018 11:50:00 +0000 (UTC) Date: Tue, 30 Jan 2018 11:50:00 +0000 (UTC) From: "Reinald Verheij (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (POOL-337) EvictionTimer does not remove cancelled tasks from the executor, leading to an IllegalStateException when the evictor attempts to evict MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Reinald Verheij created POOL-337: ------------------------------------ Summary: EvictionTimer does not remove cancelled tasks from th= e executor, leading to an IllegalStateException when the evictor attempts t= o evict Key: POOL-337 URL: https://issues.apache.org/jira/browse/POOL-337 Project: Commons Pool Issue Type: Bug Affects Versions: 2.5.0 Reporter: Reinald Verheij EvictionTimer does not remove cancelled tasks from the executor, leading to= an IllegalStateException when the evictor attempts to evict. =C2=A0 EvictionTimer::schedule() adds eviction tasks to the executor, but the canc= el does not remove it. This is asymmetric and leads to the following except= ion: {noformat} java.lang.IllegalStateException: Pool not open =09at org.apache.commons.pool2.impl.BaseGenericObjectPool.assertOpen(BaseGe= nericObjectPool.java:713) =09at org.apache.commons.pool2.impl.GenericObjectPool.evict(GenericObjectPo= ol.java:721) =09at org.apache.commons.pool2.impl.BaseGenericObjectPool$Evictor.run(BaseG= enericObjectPool.java:1077) =09at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:51= 1) =09at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) =09at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.= access$301(ScheduledThreadPoolExecutor.java:180) =09at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.= run(ScheduledThreadPoolExecutor.java:294) =09at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.= java:1149) =09at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor= .java:624) =09at java.lang.Thread.run(Thread.java:748){noformat} I think the cancel would need to remember the future which returned from {{= executor::scheduleWithFixedDelay()}} in {{schedule()}} and then do somethin= g like this {code}if (futures.containsKey(task)) { futures.remove(task).cancel(false); executor.purge(); }{code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)