Skip to content

fix: resolve race condition in get_dir_file_info() when files are deleted concurrently#10405

Closed
gr8man wants to merge 2 commits into
codeigniter4:developfrom
gr8man:fix/filesystem-helper-race-condition
Closed

fix: resolve race condition in get_dir_file_info() when files are deleted concurrently#10405
gr8man wants to merge 2 commits into
codeigniter4:developfrom
gr8man:fix/filesystem-helper-race-condition

Conversation

@gr8man

@gr8man gr8man commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Description
When scanning directories, get_dir_file_info() could encounter a race condition if a file was deleted right after being read by readdir(). In this scenario, get_file_info() would return null, causing an incomplete entry (lacking server_path) to be added to the result array.

This PR adds a null check to gracefully ignore files deleted mid-scan. This fixes random test failures in the Commands component, which has now been enabled for random test execution in .github/scripts/random-tests-config.txt.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value (without duplication)
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

gr8man added 2 commits July 10, 2026 00:11
This squashes several fixes regarding Entity::toRawArray returning string values instead of Time objects, addressing issue codeigniter4#8302. It also updates DatetimeCast to handle string values to prevent DataConverter crashes, and applies phpstan, rector, and cs-fix formatting.
@gr8man gr8man closed this Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant