You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@polygene.apache.org by "Niclas Hedhman (JIRA)" <ji...@apache.org> on 2015/11/10 02:46:11 UTC

[jira] [Created] (ZEST-128) Scheduler Library looses schedules

Niclas Hedhman created ZEST-128:
-----------------------------------

             Summary: 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)