Table of Contents

CPU spikes because task handler service reports it is already started

Problem Description

CPU spikes because the task handler service continuously try to start and logs the following error messages:

ERROR: Pidfile (C:\ProgramData\Lundalogik\LIME Pro Server\Task Handler\task-handler.pid) already exists.
Seems we're already running? (pid: 2064)
ERROR: Pidfile (C:\ProgramData\Lundalogik\LIME Pro Server\Task Handler\task-handler.pid) already exists.
Seems we're already running? (pid: 2064)
ERROR: Pidfile (C:\ProgramData\Lundalogik\LIME Pro Server\Task Handler\task-handler.pid) already exists.
Seems we're already running? (pid: 2064)

Solution

We recommended a upgrade to solve this issue, but there also is a manual patch available.

Upgrade

Upgrade to latest Lime CRM Server.

Manual Patch

  1. Open Registry Editor on the Lime server.
    1. Go to key:
      HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lime-task-handler\Parameters

      Change AppParameters from:

      worker -A lime_task.worker -n taskhandler1@%h -l warning --pidfile "C:\ProgramData\Lundalogik\LIME Pro Server\Task Handler\task-handler.pid" -P gevent --concurrency 2

      To:

      worker -A lime_task.worker -n taskhandler1@%h -l warning --pidfile= -P gevent --concurrency 2

    2. Go to key:
      HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lime-task-scheduler\Parameters

      Change AppParameters from (remember that the install path might differ!):

      beat -A lime_task.worker --pidfile "C:\ProgramData\Lundalogik\LIME Pro Server\Task Handler\task-scheduler.pid" -s "C:\ProgramData\Lundalogik\LIME Pro Server\Task Handler\celerybeat-schedule" -l warning

      To:

      beat -A lime_task.worker --pidfile= -s "C:\ProgramData\Lundalogik\LIME Pro Server\Task Handler\celerybeat-schedule" -l warning
  2. Restart Lime Task Service
  3. Restart Lime Task Scheduler