 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
soojin.choi
Joined: 07 May 2007 Posts: 3 Country: Australia |
|
File Driven Job runs consecutively instead of just ONCE |
|
I'm having a problem with 24x7 scheduler. When I set a file driven job (run only when a particular file is detected), 24x7 runs the job several times though the job was already sent to the queue and running. I suppose if a job is already placed in the queue and running, 24x7 should ignore further event.
The details of the job I set in 24x7...
Schedule Type: File Driven (run the job when blah.txt is detected and move blah.txt to another dir once the job is done)
Semaphore File: C:\blah.txt
Polling Interval: 1 min
Size Check Interval: 30 sec
When I execute the job, it runs twice though it is supposed to run just once and below ([Incorrect]) is the log I extracted from Schedule.log. I think it should really be like the log ([Correct]). Does anyone know how to fix this?
[Incorrect]
29/10/2007 17:26:42 0 67 0 FDI 3 Semaphore file(s) C:\blah.txt found. Submitting job to the queue.
29/10/2007 17:26:42 0 67 0 FDI 3 Job started.
29/10/2007 17:27:42 0 67 0 FDI 3 Semaphore file(s) C:\blah.txt found. Submitting job to the queue.
29/10/2007 17:27:43 0 67 0 FDI 3 Job started.
29/10/2007 17:28:30 0 67 0 FDI 3 Job finished.
29/10/2007 17:29:49 0 67 0 FDI 3 Job finished.
[Correct]
29/10/2007 14:53:10 0 61 0 FDI 3 Semaphore file(s) C:\blah.txt found. Submitting job to the queue.
29/10/2007 14:53:11 0 61 0 FDI 3 Job started.
29/10/2007 14:53:29 0 61 0 FDI 3 Semaphore file(s) C:\blah.txt found. Event is ignored because the job is already queued.
29/10/2007 14:54:35 0 61 0 FDI 3 Job finished.
|
|
Mon Oct 29, 2007 11:40 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7949
|
|
|
|
You are running an asynchronous job. You either should change the job mode to synchronous to make it block the queue while it is running or set the job to rename or move semaphore files when it starts. In the first case, if the job takes a while to run, you may see a lot of messages like "Semaphore file(s) C:\blah.txt found. Event is ignored because the job is already queued." which might be a kind of annoying message just wasting the log space. In the second case, if files are moved or renamed right away, the scheduler will NOT find them again after the job start and will NOT attempt to launch a second instance of the same job.
Please keep in mind that the scheduler checks for file presence periodically. It has not idea whether it finds same or different files. The event type is to check for file existence not for their time or check sum or something else.
Hope this process description will help you setup the job properly. You can chose appropriate rename/move options right in the definition of the job event.
|
|
Tue Oct 30, 2007 1:14 am |
|
 |
soojin.choi
Joined: 07 May 2007 Posts: 3 Country: Australia |
|
|
|
Thanks.
I changed the job mode to synchronous and it worked fine.
But there are some cases when I can't change the mode to synchronous or set the job to move semaphore file when it starts. (I assume you meant "Move the semaphore file before run" by saying that in the previous msg?). In those cases, the job ends up running consecutively and the semaphore file, which is moved to a designated dir after the job runs, gets removed though it was just set to "Move the semaphore file after run". I can set the job to "Move and rename the semaphore file after run" to avoid this problem but curious why this happens.
|
|
Tue Oct 30, 2007 2:25 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7949
|
|
|
|
To the best of my knowledge, the only jobs that cannot run synchronous are these those have to run in the background all the time or stay in the background for unknown period of time waiting for some event. File watch jobs do not typically belong to this category, as they are get-the-file and process it. If you are concerned about job concurrency, use multiple job queues and assign different jobs to different queues. It is recommended that most jobs should be set to run synchronous and detached. This will save you both time and money spend for troubleshooting various things.
|
|
Tue Oct 30, 2007 6:50 am |
|
 |
soojin.choi
Joined: 07 May 2007 Posts: 3 Country: Australia |
|
|
|
You are right about synchronous jobs saving both time and money.
However, I'm still curious why semaphore file, which is moved to a desinated dir after the job run, gets deleted when a file driven job runs asynchronous. It should really be just overwrited not deleted???
|
|
Wed Oct 31, 2007 8:04 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7949
|
|
|
|
I'm not sure what asynchronous job has to do with file deletion. Please think of asynchronous job as a job to kick and let it go on its own, while a synchronous is job is to kick and wait for it to complete before doing anything else for that or the following job. Take a look at the "Job Processing Flow" topic in the online help. That topic describes how different types of jobs are processed and when and which events occur during processing of different job types.
|
|
Wed Oct 31, 2007 11:37 pm |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|