Skip to content

[data] Fix CheckpointConfig FileNotFoundError on Azure Blob Storage - #63606

Merged
richardliaw merged 3 commits into
ray-project:masterfrom
michael-pryor:fix-checkpoint-azure-filenotfound
May 28, 2026
Merged

richardliaw merged 3 commits into
ray-project:masterfrom
michael-pryor:fix-checkpoint-azure-filenotfound

Conversation

@michael-pryor

Copy link
Copy Markdown
Contributor

Why are these changes needed?

_clean_pending_checkpoints_task in checkpoint_filter.py uses FileSelector without allow_not_found=True when listing checkpoint files:

ckpt_files = checkpoint_filesystem.get_file_info(
    FileSelector(checkpoint_path_unwrapped, recursive=False)
)

On S3, listing a non-existent prefix returns an empty result. On Azure Blob Storage, it raises FileNotFoundError. This breaks CheckpointConfig on Azure for first-run scenarios where the checkpoint directory does not yet exist.

The data file listing in the same function already correctly uses allow_not_found=True:

data_files = data_file_filesystem.get_file_info(
    FileSelector(data_file_dir_unwrapped, recursive=True, allow_not_found=True)
)

Similarly, the load_checkpoint method in CheckpointManager also uses allow_not_found=True for its own FileSelector call.

This was introduced in #61821 which was only tested on S3.

Fix

Add allow_not_found=True to the FileSelector call in _clean_pending_checkpoints_task.

Related issue number

N/A

Checks

This PR was authored with Cursor assistance.

Made with Cursor

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the _clean_pending_checkpoints_task function in checkpoint_filter.py to include allow_not_found=True in the FileSelector call. This change prevents potential errors when the checkpoint directory does not exist during the cleaning process. I have no feedback to provide as there were no review comments.

Add allow_not_found=True to FileSelector in _clean_pending_checkpoints_task
to handle non-existent checkpoint directories on Azure Blob Storage.

Update test_clean_pending_checkpoints_task_failure to match the new
behavior: a non-existent checkpoint directory now returns an empty list
instead of raising, so cleanup succeeds gracefully.

Signed-off-by: Michael Pryor <[email protected]>
@michael-pryor
michael-pryor force-pushed the fix-checkpoint-azure-filenotfound branch from d87510e to c1b6bce Compare May 22, 2026 23:52
@richardliaw

Copy link
Copy Markdown
Contributor

@owenowenisme can you help review?

@richardliaw richardliaw changed the title Fix CheckpointConfig FileNotFoundError on Azure Blob Storage [data] Fix CheckpointConfig FileNotFoundError on Azure Blob Storage May 26, 2026
@richardliaw richardliaw added the go add ONLY when ready to merge, run all tests label May 26, 2026
@michael-pryor
michael-pryor marked this pull request as ready for review May 27, 2026 08:17
@michael-pryor
michael-pryor requested a review from a team as a code owner May 27, 2026 08:17
@ray-gardener ray-gardener Bot added data Ray Data-related issues community-contribution Contributed by the community labels May 27, 2026
@owenowenisme owenowenisme self-assigned this May 27, 2026

@owenowenisme owenowenisme left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@richardliaw
richardliaw merged commit c1b525f into ray-project:master May 28, 2026
3 checks passed
rueian pushed a commit to rueian/ray that referenced this pull request Jun 4, 2026
…ay-project#63606)

## Why are these changes needed?

`_clean_pending_checkpoints_task` in `checkpoint_filter.py` uses
`FileSelector` without `allow_not_found=True` when listing checkpoint
files:

```python
ckpt_files = checkpoint_filesystem.get_file_info(
    FileSelector(checkpoint_path_unwrapped, recursive=False)
)
```

On S3, listing a non-existent prefix returns an empty result. On Azure
Blob Storage, it raises `FileNotFoundError`. This breaks
`CheckpointConfig` on Azure for first-run scenarios where the checkpoint
directory does not yet exist.

The data file listing in the same function already correctly uses
`allow_not_found=True`:

```python
data_files = data_file_filesystem.get_file_info(
    FileSelector(data_file_dir_unwrapped, recursive=True, allow_not_found=True)
)
```

Similarly, the `load_checkpoint` method in `CheckpointManager` also uses
`allow_not_found=True` for its own `FileSelector` call.

This was introduced in ray-project#61821 which was only tested on S3.

## Fix

Add `allow_not_found=True` to the `FileSelector` call in
`_clean_pending_checkpoints_task`.

## Related issue number

N/A

## Checks

- [x] I've signed the [Contributor License
Agreement](https://docs.google.com/forms/d/e/1FAIpQLSfAMq5v7-hRKRvNaRDhx_WP1W0IKTm7lBvpBlOrLAsNP2MKIQ/viewform).
- [ ] I've run `scripts/format.sh` to lint the changes in this PR.
- [ ] I've included any doc changes needed for
https://docs.ray.io/en/master/.
- [ ] I've added any new APIs to the API Reference. For example, if I
added a method in Tune, I've added it in `doc/source/tune/api/` (if
applicable).
- [ ] I've made sure the tests are passing. Note that there might be a
few flaky tests, see the recent failures at https://flakey-tests.ray.io/

*This PR was authored with Cursor assistance.*

Made with [Cursor](https://cursor.com)

---------

Signed-off-by: Michael Pryor <[email protected]>
Co-authored-by: Cursor <[email protected]>
limarkdcunha pushed a commit to limarkdcunha/ray that referenced this pull request Jun 30, 2026
…ay-project#63606)

## Why are these changes needed?

`_clean_pending_checkpoints_task` in `checkpoint_filter.py` uses
`FileSelector` without `allow_not_found=True` when listing checkpoint
files:

```python
ckpt_files = checkpoint_filesystem.get_file_info(
    FileSelector(checkpoint_path_unwrapped, recursive=False)
)
```

On S3, listing a non-existent prefix returns an empty result. On Azure
Blob Storage, it raises `FileNotFoundError`. This breaks
`CheckpointConfig` on Azure for first-run scenarios where the checkpoint
directory does not yet exist.

The data file listing in the same function already correctly uses
`allow_not_found=True`:

```python
data_files = data_file_filesystem.get_file_info(
    FileSelector(data_file_dir_unwrapped, recursive=True, allow_not_found=True)
)
```

Similarly, the `load_checkpoint` method in `CheckpointManager` also uses
`allow_not_found=True` for its own `FileSelector` call.

This was introduced in ray-project#61821 which was only tested on S3.

## Fix

Add `allow_not_found=True` to the `FileSelector` call in
`_clean_pending_checkpoints_task`.

## Related issue number

N/A

## Checks

- [x] I've signed the [Contributor License
Agreement](https://docs.google.com/forms/d/e/1FAIpQLSfAMq5v7-hRKRvNaRDhx_WP1W0IKTm7lBvpBlOrLAsNP2MKIQ/viewform).
- [ ] I've run `scripts/format.sh` to lint the changes in this PR.
- [ ] I've included any doc changes needed for
https://docs.ray.io/en/master/.
- [ ] I've added any new APIs to the API Reference. For example, if I
added a method in Tune, I've added it in `doc/source/tune/api/` (if
applicable).
- [ ] I've made sure the tests are passing. Note that there might be a
few flaky tests, see the recent failures at https://flakey-tests.ray.io/

*This PR was authored with Cursor assistance.*

Made with [Cursor](https://cursor.com)

---------

Signed-off-by: Michael Pryor <[email protected]>
Co-authored-by: Cursor <[email protected]>
400Ping pushed a commit to 400Ping/ray that referenced this pull request Aug 18, 2026
…ay-project#63606)

## Why are these changes needed?

`_clean_pending_checkpoints_task` in `checkpoint_filter.py` uses
`FileSelector` without `allow_not_found=True` when listing checkpoint
files:

```python
ckpt_files = checkpoint_filesystem.get_file_info(
    FileSelector(checkpoint_path_unwrapped, recursive=False)
)
```

On S3, listing a non-existent prefix returns an empty result. On Azure
Blob Storage, it raises `FileNotFoundError`. This breaks
`CheckpointConfig` on Azure for first-run scenarios where the checkpoint
directory does not yet exist.

The data file listing in the same function already correctly uses
`allow_not_found=True`:

```python
data_files = data_file_filesystem.get_file_info(
    FileSelector(data_file_dir_unwrapped, recursive=True, allow_not_found=True)
)
```

Similarly, the `load_checkpoint` method in `CheckpointManager` also uses
`allow_not_found=True` for its own `FileSelector` call.

This was introduced in ray-project#61821 which was only tested on S3.

## Fix

Add `allow_not_found=True` to the `FileSelector` call in
`_clean_pending_checkpoints_task`.

## Related issue number

N/A

## Checks

- [x] I've signed the [Contributor License
Agreement](https://docs.google.com/forms/d/e/1FAIpQLSfAMq5v7-hRKRvNaRDhx_WP1W0IKTm7lBvpBlOrLAsNP2MKIQ/viewform).
- [ ] I've run `scripts/format.sh` to lint the changes in this PR.
- [ ] I've included any doc changes needed for
https://docs.ray.io/en/master/.
- [ ] I've added any new APIs to the API Reference. For example, if I
added a method in Tune, I've added it in `doc/source/tune/api/` (if
applicable).
- [ ] I've made sure the tests are passing. Note that there might be a
few flaky tests, see the recent failures at https://flakey-tests.ray.io/

*This PR was authored with Cursor assistance.*

Made with [Cursor](https://cursor.com)

---------

Signed-off-by: Michael Pryor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Signed-off-by: 400Ping <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Contributed by the community data Ray Data-related issues go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants