Task Engine Issues

Identify issues with the task engine by analyzing business processes that the system isn’t executing.

Context

For example, if you look in the backoffice, you notice that the system continues to create business processes and puts them in a RUNNING state, but the system doesn’t initiate any of their sub tasks. This scenario would leave essential processes in a hanging state and can lead to a negative user experience.

A common reason for this scenario that the task worker pool has become exhausted. The task.workers.max property in SAP Commerce Cloud is set to 10 by default. If the workers execute time-consuming tasks, they can monopolize the pool and leave any new tasks waiting for their turn.

You can use the Threads and Method Hotspots features to perform the following tasks:
  • Identify these issues.
  • Determine the reasons for the instances of long-running task executions.
  • Devise solutions for these issues.

Procedure

  1. From the sidemenu, select Start of the navigation pathInfrastructure Next navigation step Technologies and processesEnd of the navigation path.

    The Technology overview page appears.

  2. Click the Apache Tomcat panel.

    The Tomcat groups appear at the bottom of the page. When dealing with task engine issues, the process group of interest is most likely to be backgroundprocessing.

  3. Click tomcat backgroundprocessing-* to list all pods that belong to this group and that run during the selected time range.

    The Process group details page appears.

  4. Click a specific pod to open its process details page.

    The pod process details page appears.

  5. Click the Further details tab.

    The Process metrics page appears.

  6. Click the Hybris TaskEngine tab to review the task queue size and execution time.

    Both metrics should have low values. If there are significant spike in ExecutionTime, it is worth investigating the task threads to understand what is causing any slowness.

  7. Return to the pod process details page by clicking the breadcrumb before the current page.

    The pod process details page appears.

  8. Click View detailed CPU breakdown.

    The Detailed CPU consumption page displays a list of services for this server along with their consumption metrics.

  9. Locate a service you want to analyze, click the More button and select Threads from the popup menu.

    The Thread analysis page appears.

  10. From the Filter requests field, remove the current filters and enable the Include waiting threads checkbox.
    To troubleshooting task worker issues, focus on the TaskExecutor-master thread group. Keep an eye out for other groups connected to the task engine, such as the following:
    • task-scheduler
    • Task-master-poll
    • TaskExecutor-master-*-Task
    • TaskExecutor-master-*-ProcessTask
    • TaskExecutor-master-*-TriggerTask
    • Threads related to specific jobs, e.g.
      • RuleEngine-module-swapping
      • SyncWorker<00004CN4 * of
      • etc.
  11. Click TaskExecutor-master lists each individual thread belonging to this group.
  12. Locate a thread you want to analyze, click the More button and select Method hotspots from the pop-up menu.

    The Method hotspots page appears.

  13. Click Hotspots to display the top hotspots and the current calling methods.

    The calling method for each hotspot appears. Click a method to display its stack trace, which appears in a way similar to reading it from a thread dump.

  14. Continue to explore the threads and the hotspots until you discover and analyze any issues in your system.