Sfoglia il codice sorgente

Fix deadlock when extracting 0 sized files from remote repositories

Jonas Borgström 11 anni fa
parent
commit
50cabd53b1
3 ha cambiato i file con 6 aggiunte e 2 eliminazioni
  1. 2 1
      CHANGES
  2. 2 0
      attic/remote.py
  3. 2 1
      attic/testsuite/archiver.py

+ 2 - 1
CHANGES

@@ -6,8 +6,9 @@ Here you can see the full list of changes between each Attic release.
 Version 0.10
 ------------
 
-(feature release, released on X)
+(bugfix release, released on Jan 30, 2014)
 
+- Fix deadlock when extracting 0 sized files from remote repositories
 - "--exclude" wildcard patterns are now properly applied to the full path
   not just the file name part (#5).
 - Make source code endianness agnostic (#1)

+ 2 - 0
attic/remote.py

@@ -111,6 +111,8 @@ class RemoteRepository(object):
             return resp
 
     def call_many(self, cmd, calls, wait=True, is_preloaded=False):
+        if not calls:
+            return
         def fetch_from_cache(args):
             msgid = self.cache[args].pop(0)
             if not self.cache[args]:

+ 2 - 1
attic/testsuite/archiver.py

@@ -104,6 +104,7 @@ class ArchiverTestCase(AtticTestCase):
         """Create a minimal test case including all supported file types
         """
         # File
+        self.create_regual_file('empty', size=0)
         self.create_regual_file('file1', size=1024 * 80)
         # Directory
         self.create_regual_file('dir2/file2', size=1024 * 80)
@@ -134,7 +135,7 @@ class ArchiverTestCase(AtticTestCase):
         with changedir('output'):
             self.attic('extract', self.repository_location + '::test')
         self.assert_equal(len(self.attic('list', self.repository_location).splitlines()), 2)
-        self.assert_equal(len(self.attic('list', self.repository_location + '::test').splitlines()), 9)
+        self.assert_equal(len(self.attic('list', self.repository_location + '::test').splitlines()), 10)
         self.assert_dirs_equal('input', 'output/input')
         info_output = self.attic('info', self.repository_location + '::test')
         shutil.rmtree(self.cache_path)