Fix sporadic "Resource temporarily unavailable" error

Issue reported on the mailing list while backing up to a remote
repository on OS X over a slow uplink.
This commit is contained in:
Jonas Borgström 2014-06-13 20:07:01 +02:00
parent 95162ce1f8
commit 15065dbaa4
2 changed files with 9 additions and 1 deletions

View File

@ -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)

View File

@ -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)