Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

add support to continue tasks #411

Closed
kaazoo opened this Issue · 3 comments

2 participants

kaazoo Min RK
kaazoo

With this example from minrk it is possible to requeue a stopped given task:

from IPython.parallel import Client
from IPython.parallel.utils import unpack_apply_message

rc = Client()
view = rc.load_balanced_view()

# get the buffers from the Hub
rec = rc.db_query(dict(msg_id=msg_id), keys=['buffers'])[0]
# reconstruct the arguments
f,args,kwargs = unpack_apply_message(rec['buffers'])
# resubmit
view.apply_async(f,*args,**kwargs)

However this will create a new task because it submits a copy with the same contents. If you don't want to keep old stopped tasks after you requeued them, you'll have to delete them with purge_results(msg_id).

Is there a way to keep the old tasks and just set their status to 'pending' again?

Min RK
Owner

true task resubmision is definitely on my todo list, but not yet implemented.

That resubmit code I showed you is not meant to be the real solution, just a hack that sort of works in the meantime.

Min RK minrk referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
Min RK
Owner

I went ahead and implemented a resubmit method as part of #413. If you check out that branch, you can see if it provides what you need. Pass one or more msg_ids, and the task(s) will be re-run from the Hub. No client-level db shenanigans necessary.

kaazoo

Thanks for implementing this funtionality. I'll add further feedback at #413.

kaazoo kaazoo closed this
Min RK minrk referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
Min RK minrk referenced this issue from a commit in minrk/ipython
Min RK minrk add Client.resubmit for re-running tasks
closes gh-411

* allow `content` in session.serialize to be a unicode object, because mongo+JSON cannot be relied upon to produce encoded bytes.
0c043a6
Brian E. Granger ellisonbg referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
Damián Avila damianavila referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
matthew von rocketstein mattvonrocketstein referenced this issue from a commit in mattvonrocketstein/ipython
Min RK minrk add Client.resubmit for re-running tasks
closes gh-411

* allow `content` in session.serialize to be a unicode object, because mongo+JSON cannot be relied upon to produce encoded bytes.
66448fc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.