Skip to main content
Inspiring
May 21, 2008
Question

Baffled! Scheduled Tasks Runs Twice in Parallel Every Time!!

  • May 21, 2008
  • 3 replies
  • 6900 views
I have a scheduled task that sends out a bunch of newsletters every day. It has been running smoothly for more than a year when it suddenly started to run twice - sending out the emails twice and updating the count twice. There have ben no changes to the source code, hardware, operating system, etc. The only change is that upgraded from MX7 to CF8.

Each time it sends a newsletter out it adds a record to a log table that is incremented automatically. From the sequencing of these records I know that it is actually running the stored procedured twice in parrallel in as much as the record ids on the duplicate records are always from 1 to 9 records apart whereas the set is more than 175 records long (the sequence gap should be at 175 records apart if it was run sequentially.

Also, the CF scheduler log only records the task as having run once. Other scheduled tasks also run twice.

The server is a Dell 1950 Dual Zeon server. CF8 is ver. 8,0,1,195765 Standard running on Windows 2003 Standard server. I am baffled as I see nothing in the code that would do this and since it worked just fine in MX7.

Any ideas anyone?????


    This topic has been closed for replies.

    3 replies

    Inspiring
    October 13, 2017

    In my case the scheduled task run twice within some milliseconds (sometimes the exact millisecond!)

    Then I logged IP number and the duplet tasks was run from another IP.

    Turned out our internet service provider had some redundat server set up that had kicked in, and somehow the "redundant" CF instance continued to run, even after our primary server kicked in again.

    I put this code in some of my scheduled task, that really helped me!

    <cflog file="myTasks" text="#GetCurrentTemplatePath()# Tickcount:#GetTickCount()# userAgent:#cgi.HTTP_USER_AGENT# IP:#cgi.REMOTE_ADDR#">

    Then you go to CF Admin and find your myTasks.log at "Log files". Check that IP

    Participating Frequently
    August 25, 2011

    I have that same issue.  I do not have CF8 running at the same time but I did upgrade from CF8.  Is there some way to manually remove all registry entries and remaining artifacts from CF8 in case that is doing it?

    Inspiring
    August 25, 2011

    Thishas been a thorn in my side for a while, and it is extremely difficult to trace or debug.  I know for sure that I only have one instance of CF9 running, and I look at the log files and only see information for one copy of a task being started and stopped, but I look at the results of the task (database info, etc) and sometimes see multiple (2x or 3x) set of data all inserted at exactly the same time.  Only happens on some tasks, not all.  Doesn't happen all the time or every time.  Only happens on the server that is still running CF8.  The CF9 machines (as far as I know!) are not showing this problem.  If anyone has any ideas for tracking down the problem beyond what I talked about above, that would be great.  I have even sat at my PC glued to perfmon showing CF activity while someone else kept firing off the scheduled task that usually shows the problem, and he would see it do the 2x or 3x executions, and I would never see the number of active CF tasks go up by more than 1.  Reboots of CF and/or the server do not have any effect.  Windows task manager only shows one copy of CF server running.  If Windows or Java is running more than once copy of the CRON process/thread I don't know how to determine that. problem will become academic at some point because I'm working on getting the CF9 licenses to upgrade the remaining CF8 servers. Sorry for the stream-of-consiousness post, will work on my prose skills next time.

    thanks in advance,

    -reed

    Inspiring
    August 25, 2011

    I meant to say that I only have one instance of CF8 running (not CF9)

    Participating Frequently
    May 21, 2008
    Hmmm, could it be possible that CF 7 and 8 are both running?
    KDN0211Author
    Inspiring
    May 21, 2008
    Brilliant!!!! I assumed that MX7 would stop running when I installed CF8. It did not! Can I safely uninstall it?

    THANKS A MILLION!