Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[air] Gracefully fail in file stat lookup race conditions #27168

Closed
Tracked by #27165
krfricke opened this issue Jul 28, 2022 · 0 comments · Fixed by #27169
Closed
Tracked by #27165

[air] Gracefully fail in file stat lookup race conditions #27168

krfricke opened this issue Jul 28, 2022 · 0 comments · Fixed by #27169
Assignees
Labels
release-blocker P0 Issue that blocks the release

Comments

@krfricke
Copy link
Contributor

ray.exceptions.RayActorError: The actor died because of an error raised in its creation task, �[36mray::_PackActor.__init__()�[39m (pid=1305, ip=172.31.89.172, repr=<ray.tune.utils.file_transfer._PackActor object at 0x7f531d725210>)
  At least one of the input arguments for this task could not be computed:
ray.exceptions.RayTaskError: �[36mray::_get_recursive_files_and_stats()�[39m (pid=1909, ip=172.31.82.95)
  File "/home/ray/anaconda3/lib/python3.7/site-packages/ray/tune/utils/file_transfer.py", line 218, in _get_recursive_files_and_stats
    stat = os.lstat(os.path.join(path, key))
FileNotFoundError: [Errno 2] No such file or directory: '/home/ray/ray_results/HorovodTrainer_2022-07-28_02-16-46/HorovodTrainer_00dc0_00002_2_lr=0.3000_2022-07-28_02-17-00/checkpoint_-00001/.tune_metadata'

This happens because the checkpoint is deleted (in a remote task) while we are in this loop:

    files_stats = {}
    for root, dirs, files in os.walk(path, topdown=False):
        rel_root = os.path.relpath(root, path)
        for file in files:
            key = os.path.join(rel_root, file)
            stat = os.lstat(os.path.join(path, key))
            files_stats[key] = stat.st_mtime, stat.st_size

We should gracefully handle file not found errors here.

See #27165

@krfricke krfricke added the release-blocker P0 Issue that blocks the release label Jul 28, 2022
@krfricke krfricke self-assigned this Jul 28, 2022
krfricke added a commit that referenced this issue Jul 28, 2022
See #27168, this fixes a race condition where a file is os.lstat'ed while being deleted.

Signed-off-by: Kai Fricke <[email protected]>
krfricke added a commit to krfricke/ray that referenced this issue Jul 28, 2022
…roject#27169)

See ray-project#27168, this fixes a race condition where a file is os.lstat'ed while being deleted.

Signed-off-by: Kai Fricke <[email protected]>
Stefan-1313 pushed a commit to Stefan-1313/ray_mod that referenced this issue Aug 18, 2022
…roject#27169)

See ray-project#27168, this fixes a race condition where a file is os.lstat'ed while being deleted.

Signed-off-by: Kai Fricke <[email protected]>
Signed-off-by: Stefan van der Kleij <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-blocker P0 Issue that blocks the release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant