polygene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niclas Hedhman (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ZEST-128) Scheduler Library looses schedules
Date Tue, 10 Nov 2015 02:08:11 GMT

    [ https://issues.apache.org/jira/browse/ZEST-128?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14997858#comment-14997858
] 

Niclas Hedhman commented on ZEST-128:
-------------------------------------

I suggest that "Durable" is made the only option. I don't see the Transient schedule to be
useful, since one can easily dispatch that to a regular java.util.concurrent.Executor.

> 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<Integer> 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)

Mime
View raw message