[Bf-blender-cvs] [87fa2d143d1] blender-v2.82-release: Codesign: Make file watcher robust for network errors

Sergey Sharybin noreply at git.blender.org
Tue Mar 10 10:26:14 CET 2020


Commit: 87fa2d143d1e6a72692068b6589074dc3eccae59
Author: Sergey Sharybin
Date:   Fri Feb 21 11:00:11 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rB87fa2d143d1e6a72692068b6589074dc3eccae59

Codesign: Make file watcher robust for network errors

===================================================================

M	build_files/buildbot/codesign/archive_with_indicator.py

===================================================================

diff --git a/build_files/buildbot/codesign/archive_with_indicator.py b/build_files/buildbot/codesign/archive_with_indicator.py
index d1af207df83..085026fcf98 100644
--- a/build_files/buildbot/codesign/archive_with_indicator.py
+++ b/build_files/buildbot/codesign/archive_with_indicator.py
@@ -70,8 +70,12 @@ class ArchiveWithIndicator:
         self.archive_filepath = self.base_dir / archive_name
         self.ready_indicator_filepath = self.base_dir / ready_indicator_name
 
-    def is_ready(self) -> bool:
-        """Check whether the archive is ready for access."""
+    def is_ready_unsafe(self) -> bool:
+        """
+        Check whether the archive is ready for access.
+
+        No guarding about possible network failres is done here.
+        """
         if not self.ready_indicator_filepath.exists():
             return False
 
@@ -105,6 +109,26 @@ class ArchiveWithIndicator:
 
         return True
 
+    def is_ready(self) -> bool:
+        """
+        Check whether the archive is ready for access.
+
+        Will tolerate possible network failures: if there is a network failure
+        or if there is still no proper permission on a file False is returned.
+        """
+
+        # There are some intermitten problem happening at a random which is
+        # translates to "OSError : [WinError 59] An unexpected network error occurred".
+        # Some reports suggests it might be due to lack of permissions to the file,
+        # which might be applicable in our case since it's possible that file is
+        # initially created with non-accessible permissions and gets chmod-ed
+        # after initial creation.
+        try:
+            return self.is_ready_unsafe()
+        except OSError as e:
+            print(f'Exception checking archive: {e}')
+            return False
+
     def tag_ready(self) -> None:
         """
         Tag the archive as ready by creating the corresponding indication file.



More information about the Bf-blender-cvs mailing list