Requeuing missing frames with script

Hi everyone,
I’m currently trying to write a post-task script to check for missing frames in a render. So far I’ve managed to get an array of numbers with all missing frames in a task, and now I want to create a new task to re-render those frames. Is there any Deadline python function that allows me to requeue certain frames/tasks?
Best regards,

Dirk

Hi Dirk,

You could use the ExecuteCommand function here to call a DeadlineCommand operation to requeue tasks:
thinkboxsoftware.com/deadlin … _Utilities

Here is the usage of the “RequeueJobTask” operation:

Hope this helps!

  • Ryan

Hi,

thanks for the quick help. I am now trying to get the job id and task id. The job is no problem since its listed in the job info file, but how can I get the task id? I’ve tried to read it by using SlaveUtils.GetCurrentSlaveInfoValue( “CurrentTaskIds” ), but I get no value in the PostTaskScript (I assume the value is empty by the time the PostTaskScript is executed…)

Hmm, I guess there isn’t a way to explicitly get the current task ID. I’ve logged this as a feature request, as I think it would be a useful addition to the script API.

A potential workaround for now is to call GetJobTaskIds from deadlinecommand:

This will give you all the task IDs for the job, and hopefully you can parse out the task ID(s) you’re interested in based on the frame numbers. Note that a task ID is build up like this:

[Job ID][Task Number][Start Frame]-[End Frame]

Cheers,

  • Ryan

OK i finally managed to read the correct task id and execute the requeue command.
But it still doesn’t seem to work when being executed by the post-task script.

rqCol = StringCollection()
rqCol.Add("RequeueJobTask")
rqCol.Add(jobId)
rqCol.Add(str(error_task_id))
requeue = ScriptUtils.ExecuteCommandAndGetOutput(rqCol)

The resulting error messages are the following (either the first or the second one appears):
"Error: Cannot requeue a task with status Queued "
"Error: Could not find this task because it has recently changed states. "

The problem is: The task remains “Completed” in the Monitor’s task list and does not get requeued…
I have already been trying to implement a Sleep() function for 10 seconds, but it makes no difference.

Hmm, there were some cache issues when calling ExecuteCommand (ie: DeadlineCommand calls actually used a separate cache). I wonder if this is the cause of the problem. This has been fixed in Deadline 5.0 (which will be released later today).

A potential workaround for now might be to launch DeadlineCommand.exe as a separate process, instead of using the ExecuteCommandAndGetOutput function. That would ensure it has a refreshed cache.

Hi, Its an old thread – but i could really use such scripts where I can run post script to check the missing frames in the tasks output folders and automatically reque them… anyone willing to share ? Thanks

Does this feature help? “Scan For Missing Output”?
docs.thinkboxsoftware.com/produc … job-output

:slight_smile: Thanks !