Author Topic: Python: retry failed frames - How to?  (Read 2896 times)

laschmoove

  • Sr. Member
  • ****
  • Posts: 29
Python: retry failed frames - How to?
« on: March 19, 2010, 03:43:16 PM »
Hi everybody,

I am trying to re-run failed frames in a python script like so:
Code: [Select]
qb.retrywork('816:4', '816:5')

As the docs say, the frames enter pending state, but they stay there forever.
What do I need to do to get them running?
Or which is the best way to trigger a "retry failed frames" like in the GUI from python?

Thanks for helping,
laschmoove

jburk

  • Administrator
  • *****
  • Posts: 483
Re: Python: retry failed frames - How to?
« Reply #1 on: March 19, 2010, 06:25:01 PM »
You also need to retry some subjobs (the GUI does this automagically for you); there are probably no subjobs in a pending state  to render the retried frames.  Do a
Code: [Select]
qb.jobinfo(id=123, subjobs=True) and get the list of subjobs and count up how many are running - check the  'state' (in case the job is still actually running).  If you decide there aren't enough running subjobs (or there are none), decide how many of the subjobs you want to retry.

Then do
Code: [Select]
qb.retry('123.0', '123.1') to restart the subjobs.

Make sure you retry the subjobs after you retry the frames, otherwise the subjobs might start up, query the supervisor for work, told there's no work, and go complete again.  You might even consider putting 1-second sleep between the work and subjob retries.




laschmoove

  • Sr. Member
  • ****
  • Posts: 29
Re: Python: retry failed frames - How to?
« Reply #2 on: March 21, 2010, 10:36:17 AM »
Thanks a lot,

works like a charm.
I guess I need to re-read the concepts of job-subjob-agenda-stuff...

Best,
laschmoove