Try our conversational search powered by Generative AI!

Scheduled Jobs auto running of two threads at a Time


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

Sep 22, 2015 12:06

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

Sep 23, 2015 9:51

We have only Single-Server environment

Sep 23, 2015 10:12

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


Sep 23, 2015 11:17

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

Sep 23, 2015 14:25

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?

Sep 23, 2015 14:39

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

Sep 23, 2015 16:04

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.

Sep 23, 2015 17:38

We have only one Worker process running at a time .

Sep 24, 2015 10:04
* 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.