Browse Source

Merge "Retry jobs on winrm send_input failed"

Zuul 2 months ago
parent
commit
1f4d658d15
1 changed files with 9 additions and 0 deletions
  1. 9
    0
      zuul/executor/server.py

+ 9
- 0
zuul/executor/server.py View File

@@ -1959,6 +1959,15 @@ class AnsibleJob(object):
1959 1959
                     job_output.write("{now} | {line}\n".format(
1960 1960
                         now=datetime.datetime.now(),
1961 1961
                         line=line.decode('utf-8').rstrip()))
1962
+        elif ret == 2:
1963
+            # This is a workaround to detect winrm connection failures that are
1964
+            # not detected by ansible. These can be detected if the string
1965
+            # 'FATAL ERROR DURING FILE TRANSFER' is in the ansible output.
1966
+            # In this case we should treat the host as unreachable and retry
1967
+            # the job.
1968
+            for line in syntax_buffer:
1969
+                if b'FATAL ERROR DURING FILE TRANSFER' in line:
1970
+                    return self.RESULT_UNREACHABLE, None
1962 1971
 
1963 1972
         return (self.RESULT_NORMAL, ret)
1964 1973
 

Loading…
Cancel
Save