synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hiranya Jayathilaka <>
Subject Re: Buggy Code in Tasks Module?
Date Fri, 11 Sep 2009 11:08:34 GMT
FYI this is how we initialize the TaskHelper.




Note that we use one task scheduler to initialize the helper and use a
different one when initializing SimpleQuartz instances.


On Fri, Sep 11, 2009 at 4:29 PM, Hiranya Jayathilaka

> Hi Devs,
> I ran into some buggy looking code related to tasks. When a new task is
> created the SimpleQuartz#init method is called. There we get a task
> scheduler instance using the following piece of code.
> TaskScheduler taskScheduler = TaskSchedulerFactory.getTaskScheduler(
> Then when a task is stopped/removed SimpleQuartz#destroy method is called.
> There we try to get the task scheduler using the following line of code.
> TaskScheduler taskScheduler = taskHelper.getTaskScheduler();
> The task schedulers returned at the two occasions are in fact different
> (confirmed by debugging). Therefore when a task is removed from the system
> at runtime, things are not cleaned up properly and the task will continue to
> run in the background. Also the task scheduler instance set to the task
> helper is never initialized. That is another problem I encountered.
> I feel that these are actually bugs. Can somebody who's more familiar with
> the Synapse tasks module shed some light on the subject? If somebody can
> confirm I can start working on fixing them.
> Thanks
> --
> Hiranya Jayathilaka
> Software Engineer;
> WSO2 Inc.;
> E-mail:;  Mobile: +94 77 633 3491
> Blog:

Hiranya Jayathilaka
Software Engineer;
WSO2 Inc.;
E-mail:;  Mobile: +94 77 633 3491

View raw message