aboutsummaryrefslogtreecommitdiffstats
path: root/build/scripts/error.py
diff options
context:
space:
mode:
authormekagem <mekagem@yandex-team.ru>2022-02-10 16:48:44 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:48:44 +0300
commitda8aac97277cff07a0d2e4461ef132cc358bb403 (patch)
treefa6463a828ea6cc0dee98b32737fa8e31236ab83 /build/scripts/error.py
parent42763e077672e2c34762ae2170d753999fd09f97 (diff)
downloadydb-da8aac97277cff07a0d2e4461ef132cc358bb403.tar.gz
Restoring authorship annotation for <mekagem@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'build/scripts/error.py')
-rw-r--r--build/scripts/error.py38
1 files changed, 19 insertions, 19 deletions
diff --git a/build/scripts/error.py b/build/scripts/error.py
index f7d8ecb2cc0..f9e803ca197 100644
--- a/build/scripts/error.py
+++ b/build/scripts/error.py
@@ -1,35 +1,35 @@
# Sync content of this file with devtools/ya/core/error/__init__.py
-TEMPORARY_ERROR_MESSAGES = [
+TEMPORARY_ERROR_MESSAGES = [
'Connection reset by peer',
'Connection timed out',
'Function not implemented',
'I/O operation on closed file',
'Internal Server Error',
'Network connection closed unexpectedly',
- 'Network is unreachable',
+ 'Network is unreachable',
'No route to host',
'No space left on device',
'Not enough space',
'Temporary failure in name resolution',
'The read operation timed out',
'timeout: timed out',
-]
-
-
-# Node exit codes
-class ExitCodes(object):
- TEST_FAILED = 10
- COMPILATION_FAILED = 11
- INFRASTRUCTURE_ERROR = 12
+]
+
+
+# Node exit codes
+class ExitCodes(object):
+ TEST_FAILED = 10
+ COMPILATION_FAILED = 11
+ INFRASTRUCTURE_ERROR = 12
NOT_RETRIABLE_ERROR = 13
YT_STORE_FETCH_ERROR = 14
-
-
-def merge_exit_codes(exit_codes):
+
+
+def merge_exit_codes(exit_codes):
return max(e if e >= 0 else 1 for e in exit_codes) if exit_codes else 0
-
-
+
+
def is_temporary_error(exc):
import logging
logger = logging.getLogger(__name__)
@@ -47,7 +47,7 @@ def is_temporary_error(exc):
import socket
- if isinstance(exc, socket.timeout) or isinstance(getattr(exc, 'reason', None), socket.timeout):
+ if isinstance(exc, socket.timeout) or isinstance(getattr(exc, 'reason', None), socket.timeout):
logger.debug("Socket timeout exception: %s", exc)
return True
@@ -69,9 +69,9 @@ def is_temporary_error(exc):
exc_str = str(exc)
- for message in TEMPORARY_ERROR_MESSAGES:
- if message in exc_str:
+ for message in TEMPORARY_ERROR_MESSAGES:
+ if message in exc_str:
logger.debug("Found temporary error pattern (%s): %s", message, exc_str)
- return True
+ return True
return False