Skip to main content
Participant
January 20, 2010
Question

Coldfusion Scheduled Tasks Problem

  • January 20, 2010
  • 1 reply
  • 920 views

Hello--

I am experiencing a strange problem. In a product that my office has created, we make use of Scheduled Tasks in Coldfusion. All of our clients are working just fine with the exception of one. There are several Tasks that all should behave the same way. The task starts, it writes to a log file that it is starting, it processes what it needs to process, it writes to the log file that it is done.

Here is the problem we are having:

Scheduled task is scheduled to run at 3:00am daily. Task will run the first time through without any problems, and sometimes will run a second time without any problems. But, normally, the second time the task starts, the log file we have generated is not updated at all. The timestamp stays the same, so no action has been done to the file. Further, the Task doesn't do any of the process it should. In addition, the JRun process hangs, taking up 99%-100% of CPU and stays that way until the server is restarted. The Coldfusion scheduler.log says that the task has executed. Nothing else is recorded in any of the other Coldfusion logs.

This is a problem that has been reoccurring consistently for the past month with all scheduled tasks. I have spent hours on the phone with the client to debug the issue. All of the Coldfusion settings match between their environment and ours. The server setup is similar to our own server. Server is a VM with 2x3.3GHz processors and 2GB of RAM.

Does anyone have any ideas, suggestions, or help? At this point, I'm at a complete and total loss and any help would be much appreciated...

    This topic has been closed for replies.

    1 reply

    Inspiring
    January 20, 2010

    So when you say it runs fine the first time, is this "the first time after the CF server starts"?  What's the definition of "the first time"?

    I presume this is in your live environment.  Does the same thing happen in your dev / lab environment?

    It sounds to me like the application state is changing somehow (like an application variable being set), and subsequent runs of the task stuff up because of [something] to do with that state change.


    What happens if you run the task via a web browser?  And a second time straight afterwards?

    --
    Adam

    Participant
    January 20, 2010

    Sorry, yes the definition of the first time, is the first time after the server starts.

    It happens in both the Test and Production servers.

    There would be nothing that would cause a change in the application state. If it were something like that, we would be seeing this issue at our other clients. It is only this one client that is seeing the issue.

    The exact same thing happens if the task is run via a web browser. The first time after a server start, the task finishes through to completion. The second time the task is run, it will not touch the log file, and will hang up, as described above.

    Inspiring
    January 20, 2010

    Well that's all good news, in a way.

    OK, so in the test environment stop CF, blitz all the CF and JRun logs, start it, run the script via a browser, run it again.  Inspect logs.

    I can't believe nothing goes into the logs.

    And do you have a <cflog> entry as the very first line of code in the script file?  And that log entry never gets made?

    If the <cflog> entry never shows up, put an Application.cfm file in the same dir as the script, with a single <cflog> entry in it.  Does that <cflog> entry get made?

    --
    Adam