Scheduled Jobs auto running of two threads at a Time

Vote:
 

We have created a scheduled Job and it runs every day at 6 am .  We have faced some issues with it as sometimes two instances of the same job runs at the same time .

 

The Job runs at 6 am in the morning and is used to read xml files at a particular location and once the processing is completed then to delete it . So, on one particular day the job started at 6 am and another instance of the same job started after 20 or 30 minutes . So, every processesing was done twice for every file . The next scheduled date is set to next day auto matically once the job starts at 6 am so this san't be the issue.

Is there any fix or patch for this  and if there ain't then is there any suggestion on how to fix this .

Episerver CMS version : 7.0.589.1

#138462
Sep 22, 2015 12:06
Vote:
 

Do you have two or more web servers? Or is this a single-server-environment?

#138621
Sep 23, 2015 9:51
Vote:
 

We have only Single-Server environment

#138631
Sep 23, 2015 10:12
Vote:
 

you will probably require to review your code also, Are you using threading in our code?

Regards
/K

#138687
Sep 23, 2015 11:17
Vote:
 

We have single server application and we are not using any threading in our code .

#138913
Sep 23, 2015 14:25
Vote:
 

Can you check the IIS log to make sure the site has not restarted when this has happened? If a scheduled task is running when the site restarts, it will automatically restart the scheduled task as well.

Is the error handling correct? Could there be certain errors are caugth in the wrong place causing a wrong code-flow?

You say that the same job starts after 20 or 30 minutes. Are there any patterns, or is it totally random when it starts?

#138914
Sep 23, 2015 14:39
Vote:
 

This has happened totally randomly . In about 6 months it has occured twice and this job runs every day

#138922
Sep 23, 2015 16:04
Vote:
 

Have you turned on "web garden" on the application pool? This effectively runs the site in several app domains (like having a load balanced solution on one server). This is not recommended.

#138925
Sep 23, 2015 17:38
Vote:
 

We have only one Worker process running at a time .

#138962
Sep 24, 2015 10:05
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.