scheduling in DHIS

Hi Lars/Morten,

The scheduling page in DHIS 2.24 has ability to run tasks immediately in below sections.

  • Metadata Synchronization - Using ‘Sync Now’ button
  • SMS Scheduler - Using ‘Run Now’ button

When the user clicks ‘Sync Now’ button, an asynchronous task is triggered in the backend for metadata synchronization. The user can click the button again before the synchronization task is even complete. We want to prevent this as it can spawn multiple threads in the system all doing the same job leading to race conditions in system.

We can do the changes in SchedulingManager.executeTask so that it will check the status of the previously submitted task. If it is not running then it will start new task or otherwise not. These changes should be applicable to any ‘executeNow’ type tasks in the system.

Does DHIS2 already have such functionality available elsewhere in the system? Any thoughts on this approach.

Thanks

Aamer.

Hi Lars

We are looking at extending org.hisp.dhis.system.scheduling.Scheduler to also have the ability to return the ListenableFuture for a Runnable as well. This will help us or any dev in the future to check the status of the ongoing Runnables in the system and provide some user experience around it.

Please let know if you are ok with us taking it up? As we want to fix a bug wherein the “sync now” button should not be clickable if the task is already running.

Regards

Vanya

···

On Mon, Aug 8, 2016 at 9:26 AM, Aamer Mohammed aamerm@thoughtworks.com wrote:

Hi Lars/Morten,

The scheduling page in DHIS 2.24 has ability to run tasks immediately in below sections.

  • Metadata Synchronization - Using ‘Sync Now’ button
  • SMS Scheduler - Using ‘Run Now’ button

When the user clicks ‘Sync Now’ button, an asynchronous task is triggered in the backend for metadata synchronization. The user can click the button again before the synchronization task is even complete. We want to prevent this as it can spawn multiple threads in the system all doing the same job leading to race conditions in system.

We can do the changes in SchedulingManager.executeTask so that it will check the status of the previously submitted task. If it is not running then it will start new task or otherwise not. These changes should be applicable to any ‘executeNow’ type tasks in the system.

Does DHIS2 already have such functionality available elsewhere in the system? Any thoughts on this approach.

Thanks

Aamer.

With Regards
ThoughtWorks Technologies

Hyderabad

–Stay Hungry Stay Foolish!!

Hi Lars

Any comments on this one?

Regards

Vanya

···

On Wed, Aug 17, 2016 at 12:44 PM, Vanya Seth vanyas@thoughtworks.com wrote:

Hi Lars

We are looking at extending org.hisp.dhis.system.scheduling.Scheduler to also have the ability to return the ListenableFuture for a Runnable as well. This will help us or any dev in the future to check the status of the ongoing Runnables in the system and provide some user experience around it.

Please let know if you are ok with us taking it up? As we want to fix a bug wherein the “sync now” button should not be clickable if the task is already running.

Regards

Vanya

On Mon, Aug 8, 2016 at 9:26 AM, Aamer Mohammed aamerm@thoughtworks.com wrote:

Hi Lars/Morten,

The scheduling page in DHIS 2.24 has ability to run tasks immediately in below sections.

  • Metadata Synchronization - Using ‘Sync Now’ button
  • SMS Scheduler - Using ‘Run Now’ button

When the user clicks ‘Sync Now’ button, an asynchronous task is triggered in the backend for metadata synchronization. The user can click the button again before the synchronization task is even complete. We want to prevent this as it can spawn multiple threads in the system all doing the same job leading to race conditions in system.

We can do the changes in SchedulingManager.executeTask so that it will check the status of the previously submitted task. If it is not running then it will start new task or otherwise not. These changes should be applicable to any ‘executeNow’ type tasks in the system.

Does DHIS2 already have such functionality available elsewhere in the system? Any thoughts on this approach.

Thanks

Aamer.

With Regards
ThoughtWorks Technologies

Hyderabad

–Stay Hungry Stay Foolish!!

With Regards
ThoughtWorks Technologies

Hyderabad

–Stay Hungry Stay Foolish!!

Vanya,

If you’re talking about simply exposing TaskExecutor.submitListenable(Runnable) in the Scheduler interface, it’s not a big deal. I’d think you could just go ahead. Alternately you could wire the AsyncListenableTaskExecutor bean directly into the service, I suppose.

···

On Mon, Aug 22, 2016 at 12:55 PM, Vanya Seth vanyas@thoughtworks.com wrote:

Hi Lars

Any comments on this one?

Regards

Vanya


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Wed, Aug 17, 2016 at 12:44 PM, Vanya Seth vanyas@thoughtworks.com wrote:

Hi Lars

We are looking at extending org.hisp.dhis.system.scheduling.Scheduler to also have the ability to return the ListenableFuture for a Runnable as well. This will help us or any dev in the future to check the status of the ongoing Runnables in the system and provide some user experience around it.

Please let know if you are ok with us taking it up? As we want to fix a bug wherein the “sync now” button should not be clickable if the task is already running.

Regards

Vanya


With Regards
ThoughtWorks Technologies

Hyderabad

–Stay Hungry Stay Foolish!!

On Mon, Aug 8, 2016 at 9:26 AM, Aamer Mohammed aamerm@thoughtworks.com wrote:

Hi Lars/Morten,

The scheduling page in DHIS 2.24 has ability to run tasks immediately in below sections.

  • Metadata Synchronization - Using ‘Sync Now’ button
  • SMS Scheduler - Using ‘Run Now’ button

When the user clicks ‘Sync Now’ button, an asynchronous task is triggered in the backend for metadata synchronization. The user can click the button again before the synchronization task is even complete. We want to prevent this as it can spawn multiple threads in the system all doing the same job leading to race conditions in system.

We can do the changes in SchedulingManager.executeTask so that it will check the status of the previously submitted task. If it is not running then it will start new task or otherwise not. These changes should be applicable to any ‘executeNow’ type tasks in the system.

Does DHIS2 already have such functionality available elsewhere in the system? Any thoughts on this approach.

Thanks

Aamer.

With Regards
ThoughtWorks Technologies

Hyderabad

–Stay Hungry Stay Foolish!!

Halvdan Hoem Grelland

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

Hi Halvdan

We will extend the functionality and send a patch.

Regards

Vanya

···

On Mon, Aug 22, 2016 at 5:57 PM, Halvdan Hoem Grelland halvdan@dhis2.org wrote:

Vanya,

If you’re talking about simply exposing TaskExecutor.submitListenable(Runnable) in the Scheduler interface, it’s not a big deal. I’d think you could just go ahead. Alternately you could wire the AsyncListenableTaskExecutor bean directly into the service, I suppose.

On Mon, Aug 22, 2016 at 12:55 PM, Vanya Seth vanyas@thoughtworks.com wrote:

Hi Lars

Any comments on this one?

Regards

Vanya


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Halvdan Hoem Grelland

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

On Wed, Aug 17, 2016 at 12:44 PM, Vanya Seth vanyas@thoughtworks.com wrote:

Hi Lars

We are looking at extending org.hisp.dhis.system.scheduling.Scheduler to also have the ability to return the ListenableFuture for a Runnable as well. This will help us or any dev in the future to check the status of the ongoing Runnables in the system and provide some user experience around it.

Please let know if you are ok with us taking it up? As we want to fix a bug wherein the “sync now” button should not be clickable if the task is already running.

Regards

Vanya


With Regards
ThoughtWorks Technologies

Hyderabad

–Stay Hungry Stay Foolish!!

On Mon, Aug 8, 2016 at 9:26 AM, Aamer Mohammed aamerm@thoughtworks.com wrote:

Hi Lars/Morten,

The scheduling page in DHIS 2.24 has ability to run tasks immediately in below sections.

  • Metadata Synchronization - Using ‘Sync Now’ button
  • SMS Scheduler - Using ‘Run Now’ button

When the user clicks ‘Sync Now’ button, an asynchronous task is triggered in the backend for metadata synchronization. The user can click the button again before the synchronization task is even complete. We want to prevent this as it can spawn multiple threads in the system all doing the same job leading to race conditions in system.

We can do the changes in SchedulingManager.executeTask so that it will check the status of the previously submitted task. If it is not running then it will start new task or otherwise not. These changes should be applicable to any ‘executeNow’ type tasks in the system.

Does DHIS2 already have such functionality available elsewhere in the system? Any thoughts on this approach.

Thanks

Aamer.

With Regards
ThoughtWorks Technologies

Hyderabad

–Stay Hungry Stay Foolish!!

With Regards
ThoughtWorks Technologies

Hyderabad

–Stay Hungry Stay Foolish!!

Thanks Vanya,

this sounds good.

regards,

Lasr

···

On Tue, Aug 23, 2016 at 9:05 AM, Vanya Seth vanyas@thoughtworks.com wrote:

Hi Halvdan

We will extend the functionality and send a patch.

Regards

Vanya

On Mon, Aug 22, 2016 at 5:57 PM, Halvdan Hoem Grelland halvdan@dhis2.org wrote:

Vanya,

If you’re talking about simply exposing TaskExecutor.submitListenable(Runnable) in the Scheduler interface, it’s not a big deal. I’d think you could just go ahead. Alternately you could wire the AsyncListenableTaskExecutor bean directly into the service, I suppose.


With Regards
ThoughtWorks Technologies

Hyderabad

–Stay Hungry Stay Foolish!!

On Mon, Aug 22, 2016 at 12:55 PM, Vanya Seth vanyas@thoughtworks.com wrote:

Hi Lars

Any comments on this one?

Regards

Vanya


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Halvdan Hoem Grelland

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

On Wed, Aug 17, 2016 at 12:44 PM, Vanya Seth vanyas@thoughtworks.com wrote:

Hi Lars

We are looking at extending org.hisp.dhis.system.scheduling.Scheduler to also have the ability to return the ListenableFuture for a Runnable as well. This will help us or any dev in the future to check the status of the ongoing Runnables in the system and provide some user experience around it.

Please let know if you are ok with us taking it up? As we want to fix a bug wherein the “sync now” button should not be clickable if the task is already running.

Regards

Vanya


With Regards
ThoughtWorks Technologies

Hyderabad

–Stay Hungry Stay Foolish!!

On Mon, Aug 8, 2016 at 9:26 AM, Aamer Mohammed aamerm@thoughtworks.com wrote:

Hi Lars/Morten,

The scheduling page in DHIS 2.24 has ability to run tasks immediately in below sections.

  • Metadata Synchronization - Using ‘Sync Now’ button
  • SMS Scheduler - Using ‘Run Now’ button

When the user clicks ‘Sync Now’ button, an asynchronous task is triggered in the backend for metadata synchronization. The user can click the button again before the synchronization task is even complete. We want to prevent this as it can spawn multiple threads in the system all doing the same job leading to race conditions in system.

We can do the changes in SchedulingManager.executeTask so that it will check the status of the previously submitted task. If it is not running then it will start new task or otherwise not. These changes should be applicable to any ‘executeNow’ type tasks in the system.

Does DHIS2 already have such functionality available elsewhere in the system? Any thoughts on this approach.

Thanks

Aamer.

With Regards
ThoughtWorks Technologies

Hyderabad

–Stay Hungry Stay Foolish!!

Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

We have couple of fixes ready. Will send the PR’s shortly.

Regards

Vanya

···

On Sat, Sep 24, 2016 at 5:59 PM, Lars Helge Øverland lars@dhis2.org wrote:

Thanks Vanya,

this sounds good.

regards,

Lasr

On Tue, Aug 23, 2016 at 9:05 AM, Vanya Seth vanyas@thoughtworks.com wrote:

Hi Halvdan

We will extend the functionality and send a patch.

Regards

Vanya

Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

On Mon, Aug 22, 2016 at 5:57 PM, Halvdan Hoem Grelland halvdan@dhis2.org wrote:

Vanya,

If you’re talking about simply exposing TaskExecutor.submitListenable(Runnable) in the Scheduler interface, it’s not a big deal. I’d think you could just go ahead. Alternately you could wire the AsyncListenableTaskExecutor bean directly into the service, I suppose.


With Regards
ThoughtWorks Technologies

Hyderabad

–Stay Hungry Stay Foolish!!

On Mon, Aug 22, 2016 at 12:55 PM, Vanya Seth vanyas@thoughtworks.com wrote:

Hi Lars

Any comments on this one?

Regards

Vanya


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Halvdan Hoem Grelland

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

On Wed, Aug 17, 2016 at 12:44 PM, Vanya Seth vanyas@thoughtworks.com wrote:

Hi Lars

We are looking at extending org.hisp.dhis.system.scheduling.Scheduler to also have the ability to return the ListenableFuture for a Runnable as well. This will help us or any dev in the future to check the status of the ongoing Runnables in the system and provide some user experience around it.

Please let know if you are ok with us taking it up? As we want to fix a bug wherein the “sync now” button should not be clickable if the task is already running.

Regards

Vanya


With Regards
ThoughtWorks Technologies

Hyderabad

–Stay Hungry Stay Foolish!!

On Mon, Aug 8, 2016 at 9:26 AM, Aamer Mohammed aamerm@thoughtworks.com wrote:

Hi Lars/Morten,

The scheduling page in DHIS 2.24 has ability to run tasks immediately in below sections.

  • Metadata Synchronization - Using ‘Sync Now’ button
  • SMS Scheduler - Using ‘Run Now’ button

When the user clicks ‘Sync Now’ button, an asynchronous task is triggered in the backend for metadata synchronization. The user can click the button again before the synchronization task is even complete. We want to prevent this as it can spawn multiple threads in the system all doing the same job leading to race conditions in system.

We can do the changes in SchedulingManager.executeTask so that it will check the status of the previously submitted task. If it is not running then it will start new task or otherwise not. These changes should be applicable to any ‘executeNow’ type tasks in the system.

Does DHIS2 already have such functionality available elsewhere in the system? Any thoughts on this approach.

Thanks

Aamer.

With Regards
ThoughtWorks Technologies

Hyderabad

–Stay Hungry Stay Foolish!!

With Regards
ThoughtWorks Technologies

Hyderabad

–Stay Hungry Stay Foolish!!

Thank you.

Lars

···

On Mon, Sep 26, 2016 at 7:31 AM, Vanya Seth vanyas@thoughtworks.com wrote:

We have couple of fixes ready. Will send the PR’s shortly.

Regards

Vanya

On Sat, Sep 24, 2016 at 5:59 PM, Lars Helge Øverland lars@dhis2.org wrote:

Thanks Vanya,

this sounds good.

regards,

Lasr


With Regards
ThoughtWorks Technologies

Hyderabad

–Stay Hungry Stay Foolish!!

On Tue, Aug 23, 2016 at 9:05 AM, Vanya Seth vanyas@thoughtworks.com wrote:

Hi Halvdan

We will extend the functionality and send a patch.

Regards

Vanya

Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

On Mon, Aug 22, 2016 at 5:57 PM, Halvdan Hoem Grelland halvdan@dhis2.org wrote:

Vanya,

If you’re talking about simply exposing TaskExecutor.submitListenable(Runnable) in the Scheduler interface, it’s not a big deal. I’d think you could just go ahead. Alternately you could wire the AsyncListenableTaskExecutor bean directly into the service, I suppose.


With Regards
ThoughtWorks Technologies

Hyderabad

–Stay Hungry Stay Foolish!!

On Mon, Aug 22, 2016 at 12:55 PM, Vanya Seth vanyas@thoughtworks.com wrote:

Hi Lars

Any comments on this one?

Regards

Vanya


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Halvdan Hoem Grelland

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

On Wed, Aug 17, 2016 at 12:44 PM, Vanya Seth vanyas@thoughtworks.com wrote:

Hi Lars

We are looking at extending org.hisp.dhis.system.scheduling.Scheduler to also have the ability to return the ListenableFuture for a Runnable as well. This will help us or any dev in the future to check the status of the ongoing Runnables in the system and provide some user experience around it.

Please let know if you are ok with us taking it up? As we want to fix a bug wherein the “sync now” button should not be clickable if the task is already running.

Regards

Vanya


With Regards
ThoughtWorks Technologies

Hyderabad

–Stay Hungry Stay Foolish!!

On Mon, Aug 8, 2016 at 9:26 AM, Aamer Mohammed aamerm@thoughtworks.com wrote:

Hi Lars/Morten,

The scheduling page in DHIS 2.24 has ability to run tasks immediately in below sections.

  • Metadata Synchronization - Using ‘Sync Now’ button
  • SMS Scheduler - Using ‘Run Now’ button

When the user clicks ‘Sync Now’ button, an asynchronous task is triggered in the backend for metadata synchronization. The user can click the button again before the synchronization task is even complete. We want to prevent this as it can spawn multiple threads in the system all doing the same job leading to race conditions in system.

We can do the changes in SchedulingManager.executeTask so that it will check the status of the previously submitted task. If it is not running then it will start new task or otherwise not. These changes should be applicable to any ‘executeNow’ type tasks in the system.

Does DHIS2 already have such functionality available elsewhere in the system? Any thoughts on this approach.

Thanks

Aamer.

With Regards
ThoughtWorks Technologies

Hyderabad

–Stay Hungry Stay Foolish!!

Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

Hi Lars,

We have submitted PR# 154 for the same. Please have a look and let us know if any changes

Thanks

Aamer.

···

On Mon, Sep 26, 2016 at 1:10 PM, Lars Helge Øverland lars@dhis2.org wrote:

Lars

Thank you.

On Mon, Sep 26, 2016 at 7:31 AM, Vanya Seth vanyas@thoughtworks.com wrote:

We have couple of fixes ready. Will send the PR’s shortly.

Regards

Vanya


Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

On Sat, Sep 24, 2016 at 5:59 PM, Lars Helge Øverland lars@dhis2.org wrote:

Thanks Vanya,

this sounds good.

regards,

Lasr


With Regards
ThoughtWorks Technologies

Hyderabad

–Stay Hungry Stay Foolish!!

On Tue, Aug 23, 2016 at 9:05 AM, Vanya Seth vanyas@thoughtworks.com wrote:

Hi Halvdan

We will extend the functionality and send a patch.

Regards

Vanya

Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

On Mon, Aug 22, 2016 at 5:57 PM, Halvdan Hoem Grelland halvdan@dhis2.org wrote:

Vanya,

If you’re talking about simply exposing TaskExecutor.submitListenable(Runnable) in the Scheduler interface, it’s not a big deal. I’d think you could just go ahead. Alternately you could wire the AsyncListenableTaskExecutor bean directly into the service, I suppose.


With Regards
ThoughtWorks Technologies

Hyderabad

–Stay Hungry Stay Foolish!!

On Mon, Aug 22, 2016 at 12:55 PM, Vanya Seth vanyas@thoughtworks.com wrote:

Hi Lars

Any comments on this one?

Regards

Vanya


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Halvdan Hoem Grelland

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

On Wed, Aug 17, 2016 at 12:44 PM, Vanya Seth vanyas@thoughtworks.com wrote:

Hi Lars

We are looking at extending org.hisp.dhis.system.scheduling.Scheduler to also have the ability to return the ListenableFuture for a Runnable as well. This will help us or any dev in the future to check the status of the ongoing Runnables in the system and provide some user experience around it.

Please let know if you are ok with us taking it up? As we want to fix a bug wherein the “sync now” button should not be clickable if the task is already running.

Regards

Vanya


With Regards
ThoughtWorks Technologies

Hyderabad

–Stay Hungry Stay Foolish!!

On Mon, Aug 8, 2016 at 9:26 AM, Aamer Mohammed aamerm@thoughtworks.com wrote:

Hi Lars/Morten,

The scheduling page in DHIS 2.24 has ability to run tasks immediately in below sections.

  • Metadata Synchronization - Using ‘Sync Now’ button
  • SMS Scheduler - Using ‘Run Now’ button

When the user clicks ‘Sync Now’ button, an asynchronous task is triggered in the backend for metadata synchronization. The user can click the button again before the synchronization task is even complete. We want to prevent this as it can spawn multiple threads in the system all doing the same job leading to race conditions in system.

We can do the changes in SchedulingManager.executeTask so that it will check the status of the previously submitted task. If it is not running then it will start new task or otherwise not. These changes should be applicable to any ‘executeNow’ type tasks in the system.

Does DHIS2 already have such functionality available elsewhere in the system? Any thoughts on this approach.

Thanks

Aamer.

With Regards
ThoughtWorks Technologies

Hyderabad

–Stay Hungry Stay Foolish!!