Skip to content

Commit

Permalink
Increase timeout and enhance error logs in lean live stop command (#…
Browse files Browse the repository at this point in the history
…371)

* Increase timeout to 1 min and enhance error logs

* nit change

* Improve error logs

* nit change
  • Loading branch information
Marinovsky authored Oct 9, 2023
1 parent 5e62db1 commit 5115b5b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lean/components/docker/docker_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ def write_to_file(self, docker_container_name: str, docker_file: Path, data: Dic
except Exception as e:
raise ValueError(f"Failed to write to {docker_file.name}: {e}")

def read_from_file(self, docker_container_name: str, docker_file: Path, interval=1, timeout=30) -> Dict[str,Any]:
def read_from_file(self, docker_container_name: str, docker_file: Path, interval=1, timeout=60) -> Dict[str,Any]:
"""Read data from file in docker.
Args:
Expand Down Expand Up @@ -499,7 +499,7 @@ def read_from_file(self, docker_container_name: str, docker_file: Path, interval
if not success:
error_message = "Rejected by Lean. Possible arguments error. Please check your logs and try again."
if not success and not error_message:
error_message = f"Failed to read result from docker file {docker_file.name} within {timeout} seconds"
error_message = f"Failed to read result from docker file {docker_file.name} within {timeout} seconds. This could be due to an action taking longer than expected. Run 'docker logs {docker_container_name}' for more information."

return {
"error": error_message,
Expand Down

0 comments on commit 5115b5b

Please sign in to comment.