Don't miss out Virtual Happy Hour this Friday (April 26).
Don't miss out Virtual Happy Hour this Friday (April 26).
Oct 04, 2017
Jun 08, 2018
CMS UI
Closed, Fixed and tested
When running a job, during a stoppage of its work (for instance, using iisreset command), the job is stuck in running state in UI. The next time the job runs, this will be restored.
Reproduction:
public override string Execute() |
{
|
string resultMessage = string.Empty;
|
int current = 0; |
try |
{
|
for(int i = 0; i< 100000; i++) |
{
|
current++;
|
|
//For long running jobs periodically check if stop is signaled and if so stop execution |
if(_stopSignaled) |
{
|
System.Threading.Thread.Sleep(60000); |
return String.Format("Stop of job was called after executed {0} items",current); |
}
|
//Call OnStatusChanged to periodically notify progress of job for manually started jobs |
OnStatusChanged(String.Format("Starting execution of {0}", current)); |
}
|
resultMessage = string.Format("Job is completed, {0} has been executed",current); |
|
}
|
catch(Exception ex) |
{
|
resultMessage = "The job could not be completed"; |
}
|
return resultMessage; |
}
|
|
Expected:
The job is not running in the database (IsRunning = 0), and the message doesn't say it is running.
Actual:
The job is not running, but the message says it is, and that problem is not fixed until the next time the job runs.
NOTE: There is a 2 minute timeout before an "unresponsive" job is picked up. Previously, the timeout was 1 hour. See http://world.episerver.com/documentation/Release-Notes/ReleaseNote/?releaseNoteId=CMS-6821.