Skip to content

Commit

Permalink
Encode TimeoutExpired texts
Browse files Browse the repository at this point in the history
If there's a timeout, the error will have to be decoded because it's assumed to be encoded. This way we prevent crashes in the manager due to `AttributeError: 'str' object has no attribute 'decode'`
  • Loading branch information
Icemole committed Jun 20, 2024
1 parent 51db853 commit 1be2f3c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sisyphus/aws_batch_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def system_call(self, command, send_to_stdin=None):
p = subprocess.run(system_command, input=send_to_stdin, capture_output=True, timeout=30)
except subprocess.TimeoutExpired:
logging.warning("Timeout expired for command: %s" % " ".join(system_command))
return [], ["TimeoutExpired"], -1
return [], ["TimeoutExpired".encode()], -1

def fix_output(o):
"""
Expand Down
2 changes: 1 addition & 1 deletion sisyphus/load_sharing_facility_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def system_call(self, command, send_to_stdin=None):
p = subprocess.run(system_command, input=send_to_stdin, capture_output=True, timeout=30)
except subprocess.TimeoutExpired:
logging.warning("Timeout expired for command: %s" % " ".join(system_command))
return [], ["TimeoutExpired"], -1
return [], ["TimeoutExpired".encode()], -1

def fix_output(o):
# split output and drop last empty line
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def system_call(self, command, send_to_stdin=None):
p = subprocess.run(system_command, input=send_to_stdin, capture_output=True, timeout=30)
except subprocess.TimeoutExpired:
logging.warning("Timeout expired for command: %s" % " ".join(system_command))
return [], ["TimeoutExpired"], -1
return [], ["TimeoutExpired".encode()], -1

def fix_output(o):
"""
Expand Down
2 changes: 1 addition & 1 deletion sisyphus/son_of_grid_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def system_call(self, command, send_to_stdin=None):
p = subprocess.run(system_command, input=send_to_stdin, capture_output=True, timeout=30)
except subprocess.TimeoutExpired:
logging.warning("Timeout expired for command: %s" % " ".join(system_command))
return [], ["TimeoutExpired"], -1
return [], ["TimeoutExpired".encode()], -1

def fix_output(o):
"""
Expand Down

0 comments on commit 1be2f3c

Please sign in to comment.