Skip to content

Handle file not found case for chmod_r utility #12861

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

Merged
merged 1 commit into from
Jul 18, 2025
Merged

Conversation

dfangl
Copy link
Member

@dfangl dfangl commented Jul 14, 2025

Motivation

It is possible, that during the execution of chmod_r on a directory, some files or directories are no longer available.

This can happen because:

  1. The file or directory are deleted in the meantime
  2. The file is a socket, which process is no longer running. It can happen that it is listed, but not actually "present" for os.stat. This happened especially in the case mysql data directories containing the mysql socket, after the process is no longer running.

Currently, we will error the entire operation, but we should ignore the file if it cannot be chmoded since it is missing (there really is no point in doing anything).

Changes

  • Capture FileNotFoundErrors when running idempotent_chmod.
  • This change is tested by its accompanying ext PR. Testing the case in this repo would be quite complex and not really worth it.

@dfangl dfangl self-assigned this Jul 14, 2025
@dfangl dfangl requested a review from simonrw July 14, 2025 10:10
@dfangl dfangl added the semver: patch Non-breaking changes which can be included in patch releases label Jul 14, 2025
Copy link

github-actions bot commented Jul 14, 2025

Test Results - Preflight, Unit

21 862 tests  ±0   20 205 ✅ ±0   6m 11s ⏱️ -41s
     1 suites ±0    1 657 💤 ±0 
     1 files   ±0        0 ❌ ±0 

Results for commit 218ff0b. ± Comparison against base commit 7720cc4.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Jul 14, 2025

Test Results (amd64) - Acceptance

7 tests  ±0   5 ✅ ±0   3m 6s ⏱️ ±0s
1 suites ±0   2 💤 ±0 
1 files   ±0   0 ❌ ±0 

Results for commit 218ff0b. ± Comparison against base commit 7720cc4.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Jul 14, 2025

Test Results (amd64) - Integration, Bootstrap

    5 files  ±0      5 suites  ±0   2h 21m 49s ⏱️ +39s
5 288 tests ±0  4 358 ✅ ±0  930 💤 ±0  0 ❌ ±0 
5 294 runs  ±0  4 358 ✅ ±0  936 💤 ±0  0 ❌ ±0 

Results for commit 218ff0b. ± Comparison against base commit 7720cc4.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Jul 14, 2025

LocalStack Community integration with Pro

    2 files  ±0      2 suites  ±0   1h 47m 20s ⏱️ + 3m 15s
4 929 tests ±0  4 152 ✅ ±0  777 💤 ±0  0 ❌ ±0 
4 931 runs  ±0  4 152 ✅ ±0  779 💤 ±0  0 ❌ ±0 

Results for commit 218ff0b. ± Comparison against base commit 7720cc4.

♻️ This comment has been updated with latest results.

@dfangl dfangl marked this pull request as ready for review July 15, 2025 09:00
@dfangl dfangl force-pushed the rds/non-root-container branch from b2358f5 to 218ff0b Compare July 17, 2025 07:32
@dfangl dfangl merged commit 1885ad2 into main Jul 18, 2025
39 checks passed
@dfangl dfangl deleted the rds/non-root-container branch July 18, 2025 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: patch Non-breaking changes which can be included in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants