Comment 1 for bug 882261

Revision history for this message
Johan Hake (johan-hake) wrote :

In addition to above error code I also sometimes get an error at the same place with this error:

  IOError: [Errno 116] Stale NFS file handle

I suspect that my file system is playing me some games here. I have tried using the following updated _read method:

    def _read(self):
        """Read the contents of our lock file.

        :return: The contents of the lock file or None if the lock file does
            not exist.
        """
        try:
            with open(self._lockfile) as fp:
                return fp.read()
        except EnvironmentError as error:
            # Avoid problems occuring when reading a file on an NFS disk
            if error.errno in [errno.EIO, errno.ESTALE]:
                self._sleep()
                return self._read()
            if error.errno != errno.ENOENT:
                raise
            return None

and it looks like it fixed my problem. Not sure it is safe to catch the EIO, ESTALE errors, and retry though.