pgiri / dispy

Distributed and Parallel Computing Framework with / for Python
https://dispy.org
Other
266 stars 55 forks source link

AttributeError: pinned #130

Open narayanapk opened 6 years ago

narayanapk commented 6 years ago
2018-05-28 18:26:52 dispyscheduler - Node <IPADDRESS> is not responding; removing it (8.0, 1527503184.46, 1527503212.55)
2018-05-28 18:26:52 pycos - uncaught exception in timer_proc/5062128:
Traceback (most recent call last):
  File "/test/pycos/__init__.py", line 3687, in _schedule
    retval = task._generator.send(task._value)
  File "/test/dispy/dispyscheduler.py", line 1107, in timer_proc
    self.reschedule_jobs(dead_jobs)
  File "/test/dispy/dispyscheduler.py", line 1589, in reschedule_jobs
    if cluster._compute.reentrant and not _job.pinned:
AttributeError: pinned
pgiri commented 6 years ago

It looks to be older version (and possibly files from two different versions mixed up?). Can you update to latest release (4.8.7) and try?

narayanapk commented 6 years ago

Nope. Not caused by Version mixup. Here is what I have found out. The instance lost its attribute ( while pickling and unpickling I guess) cause it never included in "getstate" function of class "DispyJob"

class _DispyJob_(object):
    """Internal use only.
    """
   .....
def __getstate__(self):
        state = {'uid': self.uid, 'hash': self.hash, 'compute_id': self.compute_id,
                 '_args': self._args if isinstance(self._args, str) else serialize(self._args),
                 '_kwargs': self._kwargs if isinstance(self._kwargs, str)
                                         else serialize(self._kwargs),
                 'xfer_files': self.xfer_files, 'code': self.code, 'pinned': self.pinned}
        return state
   ....

This actually resolved the issue.