# Buggy code
def reset_trial(self, trial, new_config, new_experiment_tag, logger_creator=None):
    """Tries to invoke `Trainable.reset()` to reset trial.

    Args:
        trial (Trial): Trial to be reset.
        new_config (dict): New configuration for Trial trainable.
        new_experiment_tag (str): New experiment name for trial.
        logger_creator (Callable[[Dict], Logger]): A function that
            instantiates a logger on the actor process.

    Returns:
        True if `reset_config` is successful else False.
    """
    trial.set_experiment_tag(new_experiment_tag)
    trial.set_config(new_config)
    trainable = trial.runner
    with self._change_working_directory(trial):
        with warn_if_slow("reset"):
            try:
                reset_val = ray.get(
                    trainable.reset.remote(new_config, logger_creator),
                    timeout=DEFAULT_GET_TIMEOUT,
                )
            except GetTimeoutError:
                logger.exception("Trial %s: reset timed out.", trial)
                return False
    return reset_val


# Traceback (ray.tune.error.TuneError)
2020-11-19 19:42:27,243 VINFO updater.py:460 -- `rsync`ed /root/ray_results/tune_mnist_pbt/DEFAULT_1d092_00006_6_layer_1_size=128,layer_2_size=64_2020-11-19_19-41-58/ (remote) to /root/ray_results/tune_mn
ist_pbt/DEFAULT_1d092_00006_6_layer_1_size=128,layer_2_size=64_2020-11-19_19-41-58/ (local)
2020-11-19 19:42:27,247 ERROR trial_runner.py:868 -- Trial DEFAULT_1d092_00006: Error handling checkpoint /root/ray_results/2020-11-19_19-42-24w11y5gdl/checkpoint_1/
Traceback (most recent call last):
File "/root/anaconda3/lib/python3.7/site-packages/ray/tune/trial_runner.py", line 864, in _process_trial_save
trial.on_checkpoint(trial.saving_to)
File "/root/anaconda3/lib/python3.7/site-packages/ray/tune/trial.py", line 498, in on_checkpoint
self, checkpoint.value))
ray.tune.error.TuneError: Trial DEFAULT_1d092_00006: Checkpoint path /root/ray_results/2020-11-19_19-42-24w11y5gdl/checkpoint_1/ not found after successful sync down.
2020-11-19 19:42:27,250 WARNING util.py:140 -- The `process_trial_save` operation took 1.05049467086792 seconds to complete, which may be a performance bottleneck.

# Fixed code
def reset_trial(self, trial, new_config, new_experiment_tag, logger_creator=None):
    """Tries to invoke `Trainable.reset()` to reset trial.

    Args:
        trial (Trial): Trial to be reset.
        new_config (dict): New configuration for Trial trainable.
        new_experiment_tag (str): New experiment name for trial.
        logger_creator (Optional[Callable[[Dict], Logger]]): Function
            that instantiates a logger on the actor process.

    Returns:
        True if `reset_config` is successful else False.
    """
    trial.set_experiment_tag(new_experiment_tag)
    trial.set_config(new_config)
    trainable = trial.runner
    with self._change_working_directory(trial):
        with warn_if_slow("reset"):
            try:
                reset_val = ray.get(
                    trainable.reset.remote(new_config, logger_creator),
                    timeout=DEFAULT_GET_TIMEOUT,
                )
            except GetTimeoutError:
                logger.exception("Trial %s: reset timed out.", trial)
                return False
    return reset_val