WAS v8.5 > Develop applications > Develop Scheduler service > Develop and schedule tasks

Stopping tasks that are failing

The scheduler runs tasks in a global transactional context, by default. If a task is failing due to a configuration problem or application error, the scheduler attempts to retry the task until the scheduler failure threshold is reached. This topic describes how to stop the tasks that are failing.

The default scheduler failure threshold is 10 and can be configured using the taskFailureThreshold scheduler custom property. To configure this custom property, in the dmgr console click Resources > Schedulers > scheduler_name and click Custom Properties. Valid values are non-negative integers, that is, integers greater than 0.

When the task reaches the failure threshold, the scheduler stops running the task until the scheduler daemon is restarted using the WASScheduler MBean, the scheduler fails over to another server, or until the scheduler is resumed using the resume method on the Scheduler API or WASScheduler MBean.

  1. Cancel or suspend a transactional (QOS_ONLYONCE) task that is continually failing. This action can be difficult if the scheduler has not yet reached the failure threshold. The cancel and suspend Scheduler API methods or WASScheduler MBean operations block until the task fails or the method times out, while waiting for a database lock and throws a TaskPending exception. If this occurs, then the application can retry the cancel or suspend operation until it completes.
  2. Alternatively, stop the scheduler daemon using the stopDaemon operation on the WASScheduler MBean to avoid running the task multiple times, and run the cancel or suspend operation while it is stopped. While the daemon is stopped, the scheduler does not run tasks. However, all MBean operations and API methods are still available.


Related concepts:

Scheduler daemon


+

Search Tips   |   Advanced Search