1

We have a CF2016 instance that runs all our scheduled tasks. This one particular task runs every day at 4:45am. Monday through Saturday the task runs quickly, but the Sunday run takes a while (this is expected), on average 60 minutes or so.

The problem is that on Sunday, the task is being fired twice. Once at 4:45am as usual, and the second is fired exactly 9 minutes & 28 seconds later while the first request has not completed and is still running. This is causing data problems for us when they are running concurrently. Both requests eventually complete.

What I've checked:

  • There is not another scheduled task that calls the same url or references this task.
  • The task has a timeout of 3 hours via cfsetting, which it is not reaching. We have other tasks that run longer that does not have the same problem.
  • Verified the Retry Count CFAdmin setting on the scheduled task is set to 0.
  • In the CFAdmin logs, I see a Starting HTTP request log for the first request, but not for the second request. I know that the second task is being fired somehow because we have logging in onRequestStart that logs CGI.SCRIPT_NAME, and it logs for both requests.
  • All tasks are called over an internal network ip address, over http (not https).

Environment is Windows 2008 R2 Enterprise, CF2016 Enterprise

How/why is this happening? Any ideas on how to diagnose why the 2nd request is being fired?

2 Answers2

0

Try using timeout specified in Server Settings > Add/Edit Scheduled Task. specify the value for "Timeout (in seconds)"

0

For scheduled tasks that should not be run in parallel you can use Exclusive CFLOCK, that will allow executing it only once at a time. See https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-tags/tags-j-l/cflock.html

As for the troubleshooting - what does scheduler.log say, can you see it being executed twice there? Scheduled tasks have I think 3 retry attempts on failure. Does the Sunday task finish without failure?

Markofo
  • 101
  • 1