Return-Path: X-Original-To: apmail-zest-dev-archive@minotaur.apache.org Delivered-To: apmail-zest-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 592B718D30 for ; Tue, 10 Nov 2015 01:49:11 +0000 (UTC) Received: (qmail 26826 invoked by uid 500); 10 Nov 2015 01:49:11 -0000 Delivered-To: apmail-zest-dev-archive@zest.apache.org Received: (qmail 26786 invoked by uid 500); 10 Nov 2015 01:49:11 -0000 Mailing-List: contact dev-help@zest.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zest.apache.org Delivered-To: mailing list dev@zest.apache.org Received: (qmail 26725 invoked by uid 99); 10 Nov 2015 01:49:11 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Nov 2015 01:49:11 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 04CD32C1F56 for ; Tue, 10 Nov 2015 01:49:11 +0000 (UTC) Date: Tue, 10 Nov 2015 01:49:11 +0000 (UTC) From: "Niclas Hedhman (JIRA)" To: dev@zest.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (ZEST-128) Scheduler Library looses schedules MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/ZEST-128?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14997829#comment-14997829 ] Niclas Hedhman commented on ZEST-128: ------------------------------------- This kind of implementations very quickly becomes awfully complex, and the key to keep them bug-free is to make them super-simple. Simple is difficult, and we haven't succeeded here. > Scheduler Library looses schedules > ---------------------------------- > > Key: ZEST-128 > URL: https://issues.apache.org/jira/browse/ZEST-128 > Project: Zest > Issue Type: Bug > Affects Versions: 2.1 > Reporter: Niclas Hedhman > Priority: Critical > > The Scheduler Library doesn't manage to keep the schedules running. Some seems to get lost, and many are never run at all. > I have modified the existing test case to show that being the case. Below, the task is only run once. > From my app, I am pretty sure it doesn't matter whether it is the same Task instance or separate instances... They get lost... > {code:Title=SchedulerTest.java} > @Test > public void testOnce() > throws UnitOfWorkCompletionException > { > final Usecase usecase = UsecaseBuilder.newUsecase( "TestOnce" ); > final String taskIdentity; > try( UnitOfWork uow = module.newUnitOfWork( usecase ) ) > { > Scheduler scheduler = module.findService( Scheduler.class ).get(); > FooTask task = createFooTask( uow, usecase.name(), BAZAR ); > taskIdentity = task.identity().get(); > scheduler.scheduleOnce( task, 1, true ); > scheduler.scheduleOnce( task, 2, true ); > scheduler.scheduleOnce( task, 3, true ); > scheduler.scheduleOnce( task, 4, true ); > uow.complete(); > } > await( usecase.name() ) > .until( taskOutput( taskIdentity ), equalTo( 4 ) ); > } > {code} > {code:Title=FooTask.java} > @UseDefaults > Property runCounter(); > abstract class Mixin > implements Runnable > { > : > : > : > @Override > public void run() > { > synchronized( this ) > { > me.runCounter().set( me.runCounter().get() + 1 ); > } > : > : > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)