Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2020-02-21 13:00:11 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2020-02-21 13:00:11 +0300
commit1f8f4c8cfeaf02754f3259f9eb811ada0ed3499e (patch)
tree8f06e4614f8f8cf18df699480a8b4c9584e7d26d /build_files/buildbot/codesign
parent973982a8e53aac02e377eaf3a3bebd3ee7b60c8e (diff)
Codesign: Make file watcher robust for network errors
Diffstat (limited to 'build_files/buildbot/codesign')
-rw-r--r--build_files/buildbot/codesign/archive_with_indicator.py28
1 files changed, 26 insertions, 2 deletions
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.