|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
Phantom Scheduled Tasks
I have a scheduled task that starts a report every 12 minutes. Sometimes aBryan S 02/15/10 02:13 P I have a lot of new information now but I'd really appreciate some help onBryan S 03/09/10 08:17 A Can't speak to the cause from afar. But to prevent reports fromDorioo 03/09/10 08:41 A Thanks a lot for the reply. I simplified my explanation to get right to theBryan S 03/09/10 08:52 A You could dynamically name the lock to use the same name (only oneDorioo 03/09/10 09:22 A So today's work narrows things down even further.Bryan S 03/09/10 03:54 P Cflocation within a scheduled task would be the first thing I'd tossDorioo 03/09/10 04:11 P Well, I think I know why I didn't use that originally. It is not working. IBryan S 03/10/10 09:24 A Dump "cfhttp" after the call and it will show you useful informationDorioo 03/10/10 09:33 A -The good news...Bryan S 03/10/10 01:51 P Also, what version of CF are you running?Dorioo 03/10/10 02:01 P GabrielBryan S 03/10/10 02:12 P GabrielBryan S 03/10/10 02:22 P In event 2, put in something that saves off all the CGI/form/urlDURETTE, STEVEN J (ATTASIAIT) 03/10/10 02:02 P I have code that dumps any exception to a file. Previously I put a cfthrowBryan S 03/10/10 02:15 P Bryan,DURETTE, STEVEN J (ATTASIAIT) 03/10/10 02:36 P SteveBryan S 03/10/10 02:49 P Bryan,DURETTE, STEVEN J (ATTASIAIT) 03/10/10 03:34 P SteveBryan S 03/10/10 04:20 P The data are the same for both the desired call and the unexplained call toBryan S 03/11/10 10:29 A Is the CF7 server fully patched? I seem to remember a fix for scheduledDURETTE, STEVEN J (ATTASIAIT) 03/11/10 10:34 A "After restarting the server, the scheduled tasks are activated twice." ??Dorioo 03/11/10 11:24 A Gabriel and SteveBryan S 03/11/10 01:27 P Is your scheduled task scheduled to run every 5 minutes? Do you haveDorioo 03/11/10 01:32 P The scheduled task is scheduled to run every 10 minutes. There is noBryan S 03/11/10 01:48 P I have not followed this thread to know if this has been asked.Ian Skinner 03/11/10 01:54 P IanBryan S 03/11/10 05:29 P Something to test: I'd change the scheduled task to run at somethingDorioo 03/11/10 05:36 P I changed the interval on the Scheduled Task from 10 minutes to 7 minutes.Bryan S 03/12/10 07:53 A Bryan...Rick Faircloth 03/11/10 08:52 P I disabled all of the existing Scheduled Tasks relating to this application.Bryan S 03/12/10 07:58 A Another test comes to mind. I'd change the call to run a report to doDorioo 03/12/10 08:09 A GabrielBryan S 03/12/10 10:01 A So it wrote the file again 5 minutes later? Do any of your otherDorioo 03/12/10 10:10 A GabrielBryan S 03/12/10 10:22 A Bryan,DURETTE, STEVEN J (ATTASIAIT) 03/12/10 10:27 A SteveBryan S 03/12/10 10:44 A I saw the timestamp but was wondering if your code was _only_ creatingDorioo 03/12/10 10:43 A I can't even get our server guys to respond with an answer if the latestBryan S 03/12/10 11:06 A Not having full control is definitely going to impede your testing.Dorioo 03/12/10 11:20 A I am now getting the same behavior running Event1 from a Linux Cron Job withBryan S 03/17/10 02:35 P > There is only one cfhttp call in the whole app and no cflocation calls.denstar 03/17/10 07:32 P DenBryan S 03/19/10 11:57 A > Dendenstar 03/19/10 12:13 P Did you declare "var" twice in your cfdump like posted? I'd remove theDorioo 03/10/10 02:03 P Its a bit of a kludge - but could you add some cfif code to check the time and if it didn't meet the criteria it wouldn't process?John Drake 03/10/10 01:05 P Thanks for trying John but this won't help me. There are only certainBryan S 03/10/10 02:10 P Bryan said:Earl, George 03/12/10 08:24 A I have a scheduled task that starts a report every 12 minutes. Sometimes a report is started 5 minutes after the scheduled report starts. There is no evidence anywhere of the scheduled task being fired. There is no manual process starting the report. I have discovered long ago that modifying a scheduled task while it is running creates a phantom hidden task that can only be exorcised by rebooting the server. To allow reconfiguration of the task without worrying about this problem I wrote a process that can be configured. The scheduled task calls the process and acts according to its configuration. The scheduled task in question is set to fire a report process every twelve minutes. The process of the report can be followed in an application log. The desired report starts and is logged. At seemingly random times a report starts five minutes later. It is always five minutes never four or six etc. Again, there is no manual process starting this. There is no evidence of the scheduled task firing. There is no loop in the application that could start multiple reports with one url firing. What could be starting the report. I have a lot of new information now but I'd really appreciate some help on this because I still have the problem. I've never had much luck getting response to my questions on this forum. If I am doing something wrong please let me know. I'm going to *try* to keep this as simple as possible. I am able to simplify it because of all the testing I have done in the last few weeks. I have a Cold Fusion Scheduled Task the purpose of which is to start a report if no other report is running at that time. The scheduled task fires Event1 which checks if a report is running and if there is no report running it fires Event2 which starts a report. I have separate logging in Event1 and Event2 so I can tell when each one fires. Event1 finds no report running and fires Event2 which starts ReportA. One minute later it checks and finds ReportA running so it does not fire Event2. This continues until five minutes after ReportA started. Five minutes after ReportA starts my logging confirms that Event1 fires and correctly determines that ReportA is not running and therefore does not call Event2. HOWEVER, my logging also indicates that Event2 does get fired and as a result ReportB is started. This results in an undesirable circumstance because these are very large reports and when run concurrently they use up all available memory on the server. To debug this problem I turned off all Scheduled Tasks except 1 and found that both calls to Event2 are coming from the original call to Event1. If I turn off all Scheduled Tasks no reports ever get fired so it can not be a Cold Fusion Scheduled Task call on another server somewhere. The really odd thing is that once two reports are running no other reports start until both reports finish. Once both reports finish the cycle repeats. A report starts, then five minutes later another one starts. Never four minutes or six minutes, always five. I assure you I did not code anything that does this. I am checking if a report is running but not when it started. To further add to the puzzle if I manually run the event called by the Cold Fusion Scheduled Task this problem does not occur. It then correctly waits until ReportA finishes before starting ReportB. Nothing happens at the five minute mark. Any thoughts on what could be happening would be greatly appreciated. Thanks. Bryan Sent: Monday, February 15, 2010 2:11 PM To: cf-talk@houseoffusion.com Subject: Phantom Scheduled Tasks I have a scheduled task that starts a report every 12 minutes. Sometimes a report is started 5 minutes after the scheduled report starts. There is no evidence anywhere of the scheduled task being fired. There is no manual process starting the report. I have discovered long ago that modifying a scheduled task while it is running creates a phantom hidden task that can only be exorcised by rebooting the server. To allow reconfiguration of the task without worrying about this problem I wrote a process that can be configured. The scheduled task calls the process and acts according to its configuration. The scheduled task in question is set to fire a report process every twelve minutes. The process of the report can be followed in an application log. The desired report starts and is logged. At seemingly random times a report starts five minutes later. It is always five minutes never four or six etc. Again, there is no manual process starting this. There is no evidence of the scheduled task firing. There is no loop in the application that could start multiple reports with one url firing. What could be starting the report. Can't speak to the cause from afar. But to prevent reports from running concurrently, maybe you can put a named CFLOCK around all of the report generation events. If they all shared the same name, only one would ever have the lock and, if a second started to run while the first was running, it would simply time out and not do anything. Something like this post: http://www.bennadel.com/blog/1844-Making-Sure-Scheduled-Tasks-Don-t-Overlap-In-ColdFusion.htm It's not a fix but it would mitigate multiple report events running concurrently. - Gabriel ----- Excess quoted text cut - see Original Post for more ----- Thanks a lot for the reply. I simplified my explanation to get right to the point. There are times when I want multiple reports to run at once. Event1 actually checks if a large memory hogging report is running. If not it fires Event2 even if another report is running. Bryan Can't speak to the cause from afar. But to prevent reports from running concurrently, maybe you can put a named CFLOCK around all of the report generation events. If they all shared the same name, only one would ever have the lock and, if a second started to run while the first was running, it would simply time out and not do anything. Something like this post: http://www.bennadel.com/blog/1844-Making-Sure-Scheduled-Tasks-Don-t-Overlap- In-ColdFusion.htm It's not a fix but it would mitigate multiple report events running concurrently. - Gabriel You could dynamically name the lock to use the same name (only one report runs at once) or use a unique name (allow multiples to run). Still, mitigation, not a fix. I think the lack of responses is because this may be tightly coupled to your implementation and is not general enough for constructive responses. I don't think you're doing anything wrong but it may be that you're problem is too specific to you. Maybe someone will have a Eureka moment. :) - Gabriel ----- Excess quoted text cut - see Original Post for more ----- So today's work narrows things down even further. The Cold Fusion Scheduled Task calls Event1. Event1 constructs a URL and passes it to a .cfm which uses a cflocation to fire the URL. The fired URL calls Event2 that starts a report. I pass an identifier through from the the URL called by the Cold Fusion Scheduled Task (Event1) all the way through to the URL fired by the cflocation (Event2). Five minutes later the exact same URL is fired again. There is not a second call to Event1. The Cold Fusion Scheduled Task (Event1) does not get called again. Nothing happens until both reports are finished and then the process is repeated. Bryan Cflocation within a scheduled task would be the first thing I'd toss while testing. Doesn't sit well with me. I'd replace it with a CFHTTP call (you're generating a url already) and if I really wanted to decouple the two I may put it in a CFTHREAD. Just some testing ideas. - Gabriel ----- Excess quoted text cut - see Original Post for more ----- Well, I think I know why I didn't use that originally. It is not working. I am probably doing something dumb but I haven't been able to Google this problem away. It tried two things. Neither of them worked. In my .cfm view I replaced <cflocation url="#local.desiredEvent#" addToken="Yes" / Which works with <cfhttp method="get" url="#local.desiredEvent#"> Which does not work I also tried adding this to my .cfc bypassing the .cfm entirely <cfhttp method="get" url="#local.desiredEventValues.desiredEvent#"> With these code changes nothing happens. There is no indication that the URL is being called. So what am I doing wrong? And thanks for the help. Bryan Cflocation within a scheduled task would be the first thing I'd toss while testing. Doesn't sit well with me. I'd replace it with a CFHTTP call (you're generating a url already) and if I really wanted to decouple the two I may put it in a CFTHREAD. Just some testing ideas. Dump "cfhttp" after the call and it will show you useful information (run the page in the browser so you can see the dump). Look at the status values and response for clues as to what's going. - Gabriel ----- Excess quoted text cut - see Original Post for more ----- -The good news... The cfhttp call is working now. When I tried it in the .cfc I disabled the .cfm view. When that didn't work I put the cfhttp call in the .cfm but forgot to reenable the view. -The bad news... The cfhttp call did not fix the problem. Cold Fusion Scheduled Task calls Event1 Event1 calls Event2 Five minutes exactly passes and Event2 gets fired again Event1 does not get called again No Cold Fusion Scheduled Task can be found to fire Event2. In any event how would it know to fire five minutes after Event1 is called. -The weird news... This code failed to stop and let me look at the values in cfhttp. <cfhttp method="get" url="#local.desiredEvent#"> cfhttp = <cfdump var="#cfhttp#" var="cfhttp"> <cfabort /> This problem is killing me. Bryan Dump "cfhttp" after the call and it will show you useful information (run the page in the browser so you can see the dump). Look at the status values and response for clues as to what's going. - Gabriel > > Well, I think I know why I didn't use that originally. It is not working. I > am probably doing something dumb but I haven't been able to Google this > problem away. Also, what version of CF are you running? - Gabriel ----- Excess quoted text cut - see Original Post for more ----- Gabriel We are running Cold Fusion 7 and there is no indication that is going to change any time soon. Thanks very much for trying to help. Bryan Also, what version of CF are you running? - Gabriel Gabriel O.K. I fixed the problem with the cfdump having two vars and no label but prior to reading your post showing my oversight I tried to do some file logging as shown below. The results of the top call to logEntry show in the file but the results of the second call do not. This occurred with cflocation as well. Once it gets to that line it doesn't go past it in the .cfm <cfset local.logEntry = "specialDebugging-local.desiredEvent-from-redirect-scheduled-task.cfm=" & local.desiredEvent /> <cfset logEntry("flexcomm-schedule-results","specialDebugging",local.logEntry) /> <cfhttp method="get" url="#local.desiredEvent#"> <cfset local.logEntry = "specialDebugging-AFTER CFHTTP-from-redirect-scheduled-task.cfm=" /> <cfset logEntry("flexcomm-schedule-results","specialDebugging",local.logEntry) /> cfhttp = <cfdump var="#cfhttp#" label="cfhttp"> <cfabort /> Bryan >Did you declare "var" twice in your cfdump like posted? I'd remove the >second "var" as it may not like that. > >- Gabriel In event 2, put in something that saves off all the CGI/form/url variables to a file before it does any other processing. Then you can look at the file for the second run and see what kicked it off. -The good news... The cfhttp call is working now. When I tried it in the .cfc I disabled the .cfm view. When that didn't work I put the cfhttp call in the .cfm but forgot to reenable the view. -The bad news... The cfhttp call did not fix the problem. Cold Fusion Scheduled Task calls Event1 Event1 calls Event2 Five minutes exactly passes and Event2 gets fired again Event1 does not get called again No Cold Fusion Scheduled Task can be found to fire Event2. In any event how would it know to fire five minutes after Event1 is called. -The weird news... This code failed to stop and let me look at the values in cfhttp. <cfhttp method="get" url="#local.desiredEvent#"> cfhttp = <cfdump var="#cfhttp#" var="cfhttp"> <cfabort /> This problem is killing me. Bryan Dump "cfhttp" after the call and it will show you useful information (run the page in the browser so you can see the dump). Look at the status values and response for clues as to what's going. - Gabriel > > Well, I think I know why I didn't use that originally. It is not working. I > am probably doing something dumb but I haven't been able to Google this > problem away. I have code that dumps any exception to a file. Previously I put a cfthrow in Event2 just after it started the report. This dumped the stack trace to a file. There was nothing before the call to Event2 besides the normal Mach-II event handling stuff. Bryan In event 2, put in something that saves off all the CGI/form/url variables to a file before it does any other processing. Then you can look at the file for the second run and see what kicked it off. Bryan, I'm just talking about a simple file with this information. Have it save for every call not just exceptions. Then you can see things like the browser used. If it is the cf scheduler that is somehow kicking it off then cfscheduler will be listed as the browser (or something similar). If it's a cflocation from another page, then it "should" show the http-referrer of the page. Just starting with the basics to make sure that it isn't something simple that would *NEVER* happen. You know those things that bite you in the A** because every time you thought well it's not that. (Happens to me quite often) Steve I have code that dumps any exception to a file. Previously I put a cfthrow in Event2 just after it started the report. This dumped the stack trace to a file. There was nothing before the call to Event2 besides the normal Mach-II event handling stuff. Bryan In event 2, put in something that saves off all the CGI/form/url variables to a file before it does any other processing. Then you can look at the file for the second run and see what kicked it off. Steve I already have logging code in there and it is storing the cgi.remote-addr the logged in user and information about the report it just started. As mentioned previously, I know what the stack trace is. It will be easy for me to add other variables but I can't think of any that would be useful in debugging this. Which variables do you think will help in this situation? I will add them to my existing logging. Bryan Bryan, I'm just talking about a simple file with this information. Have it save for every call not just exceptions. Then you can see things like the browser used. If it is the cf scheduler that is somehow kicking it off then cfscheduler will be listed as the browser (or something similar). If it's a cflocation from another page, then it "should" show the http-referrer of the page. Just starting with the basics to make sure that it isn't something simple that would *NEVER* happen. You know those things that bite you in the A** because every time you thought well it's not that. (Happens to me quite often) Steve I have code that dumps any exception to a file. Previously I put a cfthrow in Event2 just after it started the report. This dumped the stack trace to a file. There was nothing before the call to Event2 besides the normal Mach-II event handling stuff. Bryan In event 2, put in something that saves off all the CGI/form/url variables to a file before it does any other processing. Then you can look at the file for the second run and see what kicked it off. Bryan, I normally save all of CGI/Form/URL. The main CGI ones to look at though are: Cgi.http_referer, cgi.http_user_agent, cgi.remote_addr, cgi.request_method, cgi.script_name If cgi.remote_addr is the ip of the server then the server made the call. User agent helps to see if it was the scheduler or not. Script_name ensures that it isn't some old version (name_old.cfm) laying around that is getting called somehow. Request method helps if this comes from a form, if the method is get, then something looped around and called it. Steve Steve I already have logging code in there and it is storing the cgi.remote-addr the logged in user and information about the report it just started. As mentioned previously, I know what the stack trace is. It will be easy for me to add other variables but I can't think of any that would be useful in debugging this. Which variables do you think will help in this situation? I will add them to my existing logging. Bryan Steve Thanks very much. I've added those to my code and will run another series of tests to see if anything useful shows up. The logging that I'm doing only works with string so I can't just dump the whole cgi form and url scopes to a file without specifying each one and then the log gets kind of unwieldy with all of that in there. Bryan Bryan, I normally save all of CGI/Form/URL. The main CGI ones to look at though are: Cgi.http_referer, cgi.http_user_agent, cgi.remote_addr, cgi.request_method, cgi.script_name If cgi.remote_addr is the ip of the server then the server made the call. User agent helps to see if it was the scheduler or not. Script_name ensures that it isn't some old version (name_old.cfm) laying around that is getting called somehow. Request method helps if this comes from a form, if the method is get, then something looped around and called it. Steve The data are the same for both the desired call and the unexplained call to the URL exactly five minutes later. The five minute interval is very puzzling as is the fact that it only happens when Event1 is run *from the Cold Fusion 7 scheduler*. If I run event1 in a browser the second URL call does not occur. Bryan Steve Thanks very much. I've added those to my code and will run another series of tests to see if anything useful shows up. The logging that I'm doing only works with string so I can't just dump the whole cgi form and url scopes to a file without specifying each one and then the log gets kind of unwieldy with all of that in there. Bryan Bryan, I normally save all of CGI/Form/URL. The main CGI ones to look at though are: Cgi.http_referer, cgi.http_user_agent, cgi.remote_addr, cgi.request_method, cgi.script_name If cgi.remote_addr is the ip of the server then the server made the call. User agent helps to see if it was the scheduler or not. Script_name ensures that it isn't some old version (name_old.cfm) laying around that is getting called somehow. Request method helps if this comes from a form, if the method is get, then something looped around and called it. Steve Is the CF7 server fully patched? I seem to remember a fix for scheduled jobs running twice. I could be remembering incorrectly though. Steve The data are the same for both the desired call and the unexplained call to the URL exactly five minutes later. The five minute interval is very puzzling as is the fact that it only happens when Event1 is run *from the Cold Fusion 7 scheduler*. If I run event1 in a browser the second URL call does not occur. Bryan Steve Thanks very much. I've added those to my code and will run another series of tests to see if anything useful shows up. The logging that I'm doing only works with string so I can't just dump the whole cgi form and url scopes to a file without specifying each one and then the log gets kind of unwieldy with all of that in there. Bryan Bryan, I normally save all of CGI/Form/URL. The main CGI ones to look at though are: Cgi.http_referer, cgi.http_user_agent, cgi.remote_addr, cgi.request_method, cgi.script_name If cgi.remote_addr is the ip of the server then the server made the call. User agent helps to see if it was the scheduler or not. Script_name ensures that it isn't some old version (name_old.cfm) laying around that is getting called somehow. Request method helps if this comes from a form, if the method is get, then something looped around and called it. Steve "After restarting the server, the scheduled tasks are activated twice." ?? http://www.adobe.com/support/documentation/en/coldfusion/mx702/cf702_releasenotes.html - Gabriel On Thu, Mar 11, 2010 at 10:33 AM, DURETTE, STEVEN J (ATTASIAIT) <sd1985@att.com> wrote: ----- Excess quoted text cut - see Original Post for more ----- Gabriel and Steve There is no indication in the Cold Fusion Scheduled Task log that the Scheduled Tasks are activating twice. There is no indication in the Cold Fusion Scheduled Task log that the Scheduled Tasks are running twice. There is no indication in my application logs that Event1 which is run by the scheduled task is running twice. There *is* indication in my application log that Event2 that is fired by Event1 when appropriate is being run twice via the fired URL. One Scheduled Task, two URLs fired. One five minutes after the other. Thanks for your continued efforts to help. Bryan "After restarting the server, the scheduled tasks are activated twice." ?? http://www.adobe.com/support/documentation/en/coldfusion/mx702/cf702_release notes.html - Gabriel On Thu, Mar 11, 2010 at 10:33 AM, DURETTE, STEVEN J (ATTASIAIT) <sd1985@att.com> wrote: > > Is the CF7 server fully patched? I seem to remember a fix for scheduled > jobs running twice. I could be remembering incorrectly though. > > Steve Is your scheduled task scheduled to run every 5 minutes? Do you have the latest updater for CF7 installed? Or original CF7? - Gabriel On Thu, Mar 11, 2010 at 1:26 PM, Bryan S <bryansgroups06@gmail.com> wrote: ----- Excess quoted text cut - see Original Post for more ----- The scheduled task is scheduled to run every 10 minutes. There is no indication in the Cold Fusion Scheduled Task log that a Scheduled Task fires when it isn't scheduled to. I will check with our server administrators if the latest updater is installed. I would be surprised if it were not. I have been in regular contact with them about this issue. Bryan Is your scheduled task scheduled to run every 5 minutes? Do you have the latest updater for CF7 installed? Or original CF7? - Gabriel I have not followed this thread to know if this has been asked. But have you confirmed that there is not another ColdFusion server (development, testing, cluster, something) calling that URL as another scheduled taks on that system. I've seen that in the past where somebody sets a schedule task on the development for testing then moves it to production but leaves the development one running and somehow or the other they both actually call the same URL. Ian Yes I have looked at that on numerous occasions. In addition there is logging in my application that would indicate if that were happening. Thanks for trying to help. Bryan I have not followed this thread to know if this has been asked. But have you confirmed that there is not another ColdFusion server (development, testing, cluster, something) calling that URL as another scheduled taks on that system. I've seen that in the past where somebody sets a schedule task on the development for testing then moves it to production but leaves the development one running and somehow or the other they both actually call the same URL. Something to test: I'd change the scheduled task to run at something other than 10 minutes and see if it affects that 5 minute timeframe. Then you'd at least know that the second one is definitely tied into the first one as the 5 minute window changes when you changed the 10 minute window. - Gabriel On Thu, Mar 11, 2010 at 5:28 PM, Bryan S <bryansgroups06@gmail.com> wrote: ----- Excess quoted text cut - see Original Post for more ----- I changed the interval on the Scheduled Task from 10 minutes to 7 minutes. The second identical URL still fires exactly 5 minutes after the first. Bryan Something to test: I'd change the scheduled task to run at something other than 10 minutes and see if it affects that 5 minute timeframe. Then you'd at least know that the second one is definitely tied into the first one as the 5 minute window changes when you changed the 10 minute window. - Gabriel Bryan... Have you tried deleting your scheduled tasks and then re-entering them? Might clear the "cobwebs"... Rick Ian Yes I have looked at that on numerous occasions. In addition there is logging in my application that would indicate if that were happening. Thanks for trying to help. Bryan I have not followed this thread to know if this has been asked. But have you confirmed that there is not another ColdFusion server (development, testing, cluster, something) calling that URL as another scheduled taks on that system. I've seen that in the past where somebody sets a schedule task on the development for testing then moves it to production but leaves the development one running and somehow or the other they both actually call the same URL. I disabled all of the existing Scheduled Tasks relating to this application. I then deleted all of the existing Scheduled Tasks relating to this application. I created a new Scheduled Task with a new name and an interval of 6 minutes instead of 10 or 7. The test results were identical. The scheduled task fires and correctly determines it should run a report so it fires a URL calling the event that starts a report. Exactly 5 minutes later another identical URL fires and starts another report. There is no indication in the Cold Fusion Scheduled Task log or in my application logs that another Cold Fusion Scheduled Task fires. There is an indication in my application log that a URL calling the event that starts a report is fired again. Bryan Bryan... Have you tried deleting your scheduled tasks and then re-entering them? Might clear the "cobwebs"... Rick Another test comes to mind. I'd change the call to run a report to do something else like write a text file that's named using a UUID. Does that file get written again 5 minutes later? Testing to see if the main task runs twice for everything or if there's some relationship between running twice and making a CFHTTP call. - Gabriel ----- Excess quoted text cut - see Original Post for more ----- Gabriel configNumber is an identifier I put on the URL called by the scheduled task. I pass it all the way through for logging purposes. This is the contents of the file for the report I want to run: \uuidTest52D99D5B-0C5F-3CA2-303F0CF77BC50955\d100312.txt 167 3/12/2010 9:49 AM {ts '2010-03-12 09:49:05'} The following scheduledId was just executed: 2914 - arguments.configNumber = 1 - local.uuidForReport = 52D99D5B-0C5F-3CA2-303F0CF77BC50955 This is the contents of the file for the report I DO NOT want to run: \uuidTest52DE3980-C6AB-230F-FB79BCC2FA5D67E8\d100312.txt 167 3/12/2010 9:54 AM {ts '2010-03-12 09:54:07'} The following scheduledId was just executed: 2920 - arguments.configNumber = 1 - local.uuidForReport = 52DE3980-C6AB-230F-FB79BCC2FA5D67E8 Bryan Another test comes to mind. I'd change the call to run a report to do something else like write a text file that's named using a UUID. Does that file get written again 5 minutes later? Testing to see if the main task runs twice for everything or if there's some relationship between running twice and making a CFHTTP call. - Gabriel So it wrote the file again 5 minutes later? Do any of your other scheduled tasks behave like this one? - Gabriel ----- Excess quoted text cut - see Original Post for more ----- Gabriel Yes it does write another file five minutes later. Sorry, that is why I included the time stamps to demonstrate that. I haven't experienced this with other scheduled tasks but none of the other scheduled tasks redirect to another URL either. Bryan So it wrote the file again 5 minutes later? Do any of your other scheduled tasks behave like this one? - Gabriel > > Gabriel > > configNumber is an identifier I put on the URL called by the scheduled task. > I pass it all the way through for logging purposes. > > This is the contents of the file for the report I want to run: > \uuidTest52D99D5B-0C5F-3CA2-303F0CF77BC50955\d100312.txt 167 > 3/12/2010 9:49 AM > {ts '2010-03-12 09:49:05'} The following scheduledId was just executed: 2914 > - arguments.configNumber = 1 - local.uuidForReport = > 52D99D5B-0C5F-3CA2-303F0CF77BC50955 > > This is the contents of the file for the report I DO NOT want to run: > \uuidTest52DE3980-C6AB-230F-FB79BCC2FA5D67E8\d100312.txt 167 > 3/12/2010 9:54 AM > {ts '2010-03-12 09:54:07'} The following scheduledId was just executed: 2920 > - arguments.configNumber = 1 - local.uuidForReport = > 52DE3980-C6AB-230F-FB79BCC2FA5D67E8 Bryan, You don't by any chance have a cfschedule tag in any of your code? Maybe something is hitting code with a cfschedule tag to automatically recall the page in 5 minutes. That might explain why the second hit is always exactly 5 minutes after the original call no matter what the time frame is. Steve Gabriel Yes it does write another file five minutes later. Sorry, that is why I included the time stamps to demonstrate that. I haven't experienced this with other scheduled tasks but none of the other scheduled tasks redirect to another URL either. Bryan So it wrote the file again 5 minutes later? Do any of your other scheduled tasks behave like this one? - Gabriel > > Gabriel > > configNumber is an identifier I put on the URL called by the scheduled task. > I pass it all the way through for logging purposes. > > This is the contents of the file for the report I want to run: > \uuidTest52D99D5B-0C5F-3CA2-303F0CF77BC50955\d100312.txt 167 > 3/12/2010 9:49 AM > {ts '2010-03-12 09:49:05'} The following scheduledId was just executed: 2914 > - arguments.configNumber = 1 - local.uuidForReport = > 52D99D5B-0C5F-3CA2-303F0CF77BC50955 > > This is the contents of the file for the report I DO NOT want to run: > \uuidTest52DE3980-C6AB-230F-FB79BCC2FA5D67E8\d100312.txt 167 > 3/12/2010 9:54 AM > {ts '2010-03-12 09:54:07'} The following scheduledId was just executed: 2920 > - arguments.configNumber = 1 - local.uuidForReport = > 52DE3980-C6AB-230F-FB79BCC2FA5D67E8 > > Steve I did a global search of the application and cfschedule appears no where. Bryan Bryan, You don't by any chance have a cfschedule tag in any of your code? Maybe something is hitting code with a cfschedule tag to automatically recall the page in 5 minutes. That might explain why the second hit is always exactly 5 minutes after the original call no matter what the time frame is. Steve I saw the timestamp but was wondering if your code was _only_ creating the files or if it was still calling the CFHTTP call _and_ creating the files. In other words, is it the CFHTTP call that triggers it? Regardless, if it's not your code, that 5 minute timeframe is freaky and could be something internal to CF. 1. The updater notes for CF7 include a fix for scheduled tasks running twice. Updater notes are never that detailed so this may be related to that. Running the updater is at least an option if not already done. 2. If you've already updated and it's still occurring, I know updating from CF7 is not an option but how about running an instance of Railo and using it as a glorified scheduled task manager? It's free, open source, and newer than CF7. And you wouldn't even have to change your code as you'd be using it simply for your scheduled tasks. At a minimum, you could run an instance of it to test if the same behavior occurs through scheduled tasks created in Railo. That would help you determine if it's internal to CF7 and its scheduled tasks. - Gabriel ----- Excess quoted text cut - see Original Post for more ----- I can't even get our server guys to respond with an answer if the latest updater is installed. Therefore, I am not optimistic about my chances of them installing another application for my testing purposes. One option that has been presented that I may have to explore is to have a then create a cron job fire the URL on the Linux server. I've tried to avoid that since it makes me more dependent on our server guys which compromises my development productivity. Bryan I saw the timestamp but was wondering if your code was _only_ creating the files or if it was still calling the CFHTTP call _and_ creating the files. In other words, is it the CFHTTP call that triggers it? Regardless, if it's not your code, that 5 minute timeframe is freaky and could be something internal to CF. 1. The updater notes for CF7 include a fix for scheduled tasks running twice. Updater notes are never that detailed so this may be related to that. Running the updater is at least an option if not already done. 2. If you've already updated and it's still occurring, I know updating from CF7 is not an option but how about running an instance of Railo and using it as a glorified scheduled task manager? It's free, open source, and newer than CF7. And you wouldn't even have to change your code as you'd be using it simply for your scheduled tasks. At a minimum, you could run an instance of it to test if the same behavior occurs through scheduled tasks created in Railo. That would help you determine if it's internal to CF7 and its scheduled tasks. - Gabriel Not having full control is definitely going to impede your testing. Although it's plausible that you could run railo on your personal computer, schedule the URL that you're testing, see if it runs twice 5 minutes later, and delete railo. You'd at least know then if CF7 is the problem. - Gabriel ----- Excess quoted text cut - see Original Post for more ----- I am now getting the same behavior running Event1 from a Linux Cron Job with the Cold Fusion Scheduled Tasks turned off. I have added new code to Event2.that prevents the undesired reports from running. This does not solve the mystery, however, and it could lead to other problems so I would like to figure out the cause. Here is a summary based on my updated knowledge of the issue. My application has extensive logging which helps me piece this together. This happens if I run Event1 as a Cold Fusion Scheduled Task or as a Linux Cron Job. It DOES NOT happen if I run Event1 manually from a browser. Minute1 - Event1 checks if it should run a report and determines it should and fires Event2 which starts a report. Minute2 - Event1 checks if it should run a report and determines it should NOT and does nothing but log Minute3 - '' Minute4 - '' Minute5 - 'Event1 checks if it should run a report and determines it should NOT and does nothing but log Minute5 - Somehow a url identical to the one fired at Minute1 which runs Event2 fires (Now that I've put code in Event2 to stop it no report runs but the URL does fire and I have no idea how or why) Once the second URL fires no URLs fire until the report that started at Minute1 is complete. Then the process starts all over again. This happens whether I run Event1 once a minute, once every 10 minutes, or once every 7 minutes. If the report that started at Minute1 completes at Minute3 a report will properly start at Minute4. In this case no URL fires at Minute5. Instead it waits until Minute9 which is five minutes after the currently running report started. Thanks for your help so far. I think I've got it surrounded but I just don't know what is causing that Phantom URL to fire. There is only one cfhttp call in the whole app and no cflocation calls. Bryan ----- Excess quoted text cut - see Original Post for more ----- > There is only one cfhttp call in the whole app and no cflocation calls. Maybe it's something with cookies, is all I can think of. What happens if you turn off cookies and whatnot in your browser, and then hit the URL? :Den -- Man acts as though he were the shaper and master of language, while in fact language remains the master of man. Martin Heidegger Den The Cron Job is running the URL on a remote Linux Server. The browser settings on my PC would have no affect on it. Bryan > > There is only one cfhttp call in the whole app and no cflocation calls. Maybe it's something with cookies, is all I can think of. What happens if you turn off cookies and whatnot in your browser, and then hit the URL? :Den > Den > > The Cron Job is running the URL on a remote Linux Server. The browser > settings on my PC would have no affect on it. It was just a Hail Mary, as you'd said it works fine from your browser, but both the cron job and the scheduled task do the weirdness. :) I was playing the "what's the same and what's different" game, and cookies are a "usual suspect" when it works fine from a browser but not from something automated. The other thing I'd check would be response headers... maybe strap on a network sniffer and take a look at the traffic. :Den -- Whatever can be noted historically can be found within history. Martin Heidegger Did you declare "var" twice in your cfdump like posted? I'd remove the second "var" as it may not like that. - Gabriel ----- Excess quoted text cut - see Original Post for more ----- Its a bit of a kludge - but could you add some cfif code to check the time and if it didn't meet the criteria it wouldn't process? I.e. if the task is supposed to fire every 12 minutes - check the time when running the task and if it isn't :12, :24, :36, :48, or :00 - then don't execute. Thanks for trying John but this won't help me. There are only certain conditions when I don't want another report to start. When the server has sufficient resources to process another report I want multiple reports to run simultaneously. Event1 checks if those conditions exist. Bryan Its a bit of a kludge - but could you add some cfif code to check the time and if it didn't meet the criteria it wouldn't process? I.e. if the task is supposed to fire every 12 minutes - check the time when running the task and if it isn't :12, :24, :36, :48, or :00 - then don't execute. Bryan said: > Exactly 5 minutes later another identical URL fires and starts another > report. There is no indication in the Cold Fusion Scheduled Task log or in > my application logs that another Cold Fusion Scheduled Task fires. There > is > an indication in my application log that a URL calling the event that > starts a report is fired again. Could the 5 minutes later request be coming from another server or another instance in your environment? George
|
July 31, 2010
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||