 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
Joshua Youngblood
Joined: 14 Apr 2006 Posts: 82 Country: United States |
|
Job Hanging Forever |
|
 |
 |
joblist "Dynamic Jobs", job_list
set job_list_copy, job_list
// Count the jobs that are running.
loopuntil no_jobs_found, no_job_found
gettoken ",", job_list, job_id
choosecase job_id, end_job_id
case 0
break // There are no more jobs in the job list. End loop.
caseelse
// See if the current job is disabled.
jobdescribe job_id, "Disabled", job_describe_status
choosecase job_describe_status, end_job_describe_check
case "N"
// Jobgetstatus can only be run against enabled jobs, or it will cause the script to lock up permanently.
jobgetstatus job_id, job_status
// Increment the counter if the job is running.
choosecase job_status, end_status_check
case -3
add 1, jobs_running_count, jobs_running_count
end_status_check:
end_job_describe_check:
end_job_id:
no_job_found:
// If no jobs were running, delete all of the jobs from the job database.
choosecase jobs_running_count, end_delete_check
case 0
loopuntil no_jobs_found, no_job_found2
gettoken ",", job_list_copy, job_id
choosecase job_id, end_job_delete
case 0
break // There are no more jobs in the job list. End loop.
caseelse
// Delete the job.
jobdelete job_id
end_job_delete:
no_job_found2:
logaddmessageDB("INFO", job_num, job_name, "Finished deleting dynamic jobs from database.")
caseelse
concatex "Because of ", jobs_running_count, " running job(s), no jobs were deleted.", log_msg
logaddmessageDB("INFO", job_num, job_name, log_msg)
end_delete_check:
|
The job is scheduled to run everyday, I have tried it with asynchronization on and off, and it is attached. It works fine when I run through Test or Debug mode when it is asynchronous. It works fine when I say "Run Now" when asychronization is turned off. We know that logaddmessageDB works because many other scripts use it everyday, and it is used almost every minute of the day. Does anyone know what I may be doing wrong? I suspect that I am having trouble with my usage of jobgetstatus.
|
|
Fri Jun 22, 2007 12:17 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7955
|
|
|
|
In debug mode, you don't run the job asynchronous. Asynchronous means background run. In the Debug and Run Now / Test modes you always run job in the foreground, regardless of how it is setup. Anyway, what's wrong with setting this job to run synchronous?
|
|
Fri Jun 22, 2007 6:57 pm |
|
 |
Joshua Youngblood
Joined: 14 Apr 2006 Posts: 82 Country: United States |
|
|
|
When I set the job to run synchronous, and I run it manually, it completes running in 1-3 seconds. When I schedule the job to run synchronous at 4:30 am (when no one else is doing anything), it is still running when I arrive at 8:00 am.
|
|
Mon Jun 25, 2007 5:05 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7955
|
|
|
|
I suggest to enable the tracing option and in the morning check the log file for this job. You will see in the log what the job is doing. The log file can be found in the Performance Data subfolder. The name of the file is [job id].log.
|
|
Mon Jun 25, 2007 7:01 pm |
|
 |
Joshua Youngblood
Joined: 14 Apr 2006 Posts: 82 Country: United States |
|
|
|
The last line says, "Executing JOBGETSTATUS("37234", "0")". It just hung on this line for three hours. It was synchronous and attached.
|
|
Wed Jun 27, 2007 11:34 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7955
|
|
|
|
Please email the job trace file to support
|
|
Wed Jun 27, 2007 1:29 pm |
|
 |
Joshua Youngblood
Joined: 14 Apr 2006 Posts: 82 Country: United States |
|
|
|
The email has been sent.
|
|
Wed Jun 27, 2007 2:01 pm |
|
 |
Joshua Youngblood
Joined: 14 Apr 2006 Posts: 82 Country: United States |
|
|
|
I think that updating to 3.4.27 has corrected this problem. Thank you.
|
|
Tue Jul 10, 2007 4:52 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
|
|
|