From 4421f3a000316d64dbfe4d27c09f2da8e50620db Mon Sep 17 00:00:00 2001 From: Thomas Lecat Date: Sat, 9 May 2020 22:26:59 +0200 Subject: [PATCH] [tune] Close loggers after updating trial (#8307) (#8366) --- python/ray/tune/ray_trial_executor.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/python/ray/tune/ray_trial_executor.py b/python/ray/tune/ray_trial_executor.py index 637f5a307..c6f8adc1b 100644 --- a/python/ray/tune/ray_trial_executor.py +++ b/python/ray/tune/ray_trial_executor.py @@ -256,9 +256,6 @@ class RayTrialExecutor(TrialExecutor): error_msg (str): Optional error message. stop_logger (bool): Whether to shut down the trial logger. """ - if stop_logger: - trial.close_logger() - self.set_status(trial, Trial.ERROR if error else Trial.TERMINATED) trial.set_location(Location()) @@ -278,6 +275,8 @@ class RayTrialExecutor(TrialExecutor): self.set_status(trial, Trial.ERROR) finally: trial.set_runner(None) + if stop_logger: + trial.close_logger() def start_trial(self, trial, checkpoint=None, train=True): """Starts the trial.