diff --git a/CHANGES b/CHANGES index c86c0afd7..c80db7f71 100644 --- a/CHANGES +++ b/CHANGES @@ -8,6 +8,7 @@ Version 0.13 (feature release, released on X) +- Fix sporadic "Resource temporarily unavailable" when using remote repositories - Reduce file cache memory usage (#90) - Faster AES encryption (utilizing AES-NI when available) - Experimental Linux, OS X and FreeBSD ACL support (#66) diff --git a/attic/remote.py b/attic/remote.py index 91de21952..6c4a98ae7 100644 --- a/attic/remote.py +++ b/attic/remote.py @@ -1,3 +1,4 @@ +import errno import fcntl import msgpack import os @@ -195,7 +196,13 @@ class RemoteRepository(object): self.to_send = msgpack.packb((1, self.msgid, cmd, args)) if self.to_send: - self.to_send = self.to_send[os.write(self.stdin_fd, self.to_send):] + try: + self.to_send = self.to_send[os.write(self.stdin_fd, self.to_send):] + except OSError as e: + # io.write might raise EAGAIN even though select indicates + # that the fd should be writable + if e.errno != errno.EAGAIN: + raise if not self.to_send and not (calls or self.preload_ids): w_fds = [] self.ignore_responses |= set(waiting_for)