New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get_dict() error #3646
Comments
can you add more details? this is pretty cryptic |
Wow, I didn't expect you to read this so fast! Here are the details. |
pinging @minrk since this involves parallel |
avoids issue with LoadBalancedView, client[0], etc. Also cleanup the multiple-key test while I'm there, because it was gross. closes ipython#3646
|
I disagree, of course. Having to check how many engines are in the view before calling is extremely annoying, and also makes for a race condition. Thanks for the fix! |
How could it possibly make for a race condition? Single-engine-ness cannot change without explicit user intervention, and generally doesn't (and shouldn't) happen without creating a new View. Can I ask in what context you ran into this issue? I'm always interesting in how people are using IPython.parallel. |
DirectView is fine, but a LoadBalancedView targeting all engines will make use of new engines without the need to get recreate it. This means that engines can register (or die) before you submit the request. But anyway. I'm using IPython inside an application (VisTrails, although this particular work is not public yet) that provides a GUI for using IPython; the particular piece of code that triggered the issue is one that gets some basic info from the engines: with client.direct_view() as dview:
engines = dview.apply_async(
eval,
'(os.getpid(), platform.system(), socket.getfqdn())'
).get_dict()
print "engines:\n\tid\tsystem\tPID\tnode FQDN"
for ip_id, (pid, system, fqdn) in engines:
print "\t%d\t%s\t%d\t%s" % (ip_id, system, pid, fqdn) I'm also using a wrapper for Client to provide callbacks for AsyncResults, and thread-safety; I think we discussed that before? |
A load-balanced view is always a single-engine view in the way that matters for I don't see how the code you pasted could be what triggered the issue, because |
fix AsyncResult.get_dict for single result and add tests for single-result and invalid input (multiple results on one engine). closes #3646
Passing |
Thanks, this is most certainly a bug. Will fix shortly. |
#3654 should fix the issue of |
avoids issue with LoadBalancedView, client[0], etc. Also cleanup the multiple-key test while I'm there, because it was gross. closes ipython#3646
fix AsyncResult.get_dict for single result and add tests for single-result and invalid input (multiple results on one engine). closes ipython#3646
get_dict() doesn't return the expected {engine_id: result} dictionary when the AsyncResult is associated with a single engine.
The text was updated successfully, but these errors were encountered: