Open JamesMaroney opened 5 years ago
I believe fix committed should handle this case. Please test and confirm so new version can be released.
Thank you for identifying the cause and potential fix, which made it easy to understand the problem.
π Your fix seems to work perfectly for me. Thanks for the super fast turn-around!
I've stumbled across a little bit of an issue with how the
_Cluster
class adds items to itsworker_Q
.Around line: https://github.com/pgiri/dispy/blob/master/py3/dispy/__init__.py#L1851 the
job
object reference is mutated with the result/status/etc and is put into the Queue. The issue arises when additional results for the same job (i.e. ProvisionalResults in my case) arrive before the consumer can process the one or ones already in the Queue. In this case, thejob
instance is shared, and the entries in the queue are (I assume) accidentally mutated.A similar issue may arise here, but I am less certain about this code path: https://github.com/pgiri/dispy/blob/master/py3/dispy/__init__.py#L1779
What I've done locally to "fix" this, is added a
.clone()
method to theDispyJob
class, as below, and instead mutate/enqueue a clone of the job instance. I wouldn't be surprised if there is a better approach, but here is my implementation of the clone method in case it is helpful at all:Thanks you guys for creating this awesome tool! I've really been amazed at what dispy can do π