Skip to content

Fix framework cleanup with large numbers of files - #307

Open
avmaksimov wants to merge 1 commit into
linuxserver:masterfrom
avmaksimov:fix-framework-cleanup
Open

avmaksimov wants to merge 1 commit into
linuxserver:masterfrom
avmaksimov:fix-framework-cleanup

Conversation

@avmaksimov

Copy link
Copy Markdown

linuxserver.io


  • I have read the contributing guideline and understand that I have made the correct modifications
  • An LLM assisted me in writing the code or text for this PR
  • An LLM agent wrote the code or text for this PR

Description:

Replace the glob-based rm command with find and batched rm execution to avoid exceeding the system argument length limit.

The existing dbwait.lock condition and cleanup behavior are preserved.

Benefits of this PR and context:

Prevents framework cleanup failures when a large number of files accumulates. No additional dependencies or configuration changes are required.

Closes #306

How Has This Been Tested?

Tested on Ubuntu Server 24.04 LTS (x86-64), Docker 29.8.0, Docker Compose v5.5.1 and MariaDB 11.8.10.

The original error was reproduced using the official v26.09.3-ls301 image. The modified image was built from source and tested in an isolated Docker environment.

  • Successfully removed all 77,396 generated files during container recreation.
  • Verified preservation of hidden entries, framework directories and symbolic link targets.
  • Verified that cleanup is skipped when dbwait.lock exists.
  • Verified that a session marker survives a normal container restart.
  • Confirmed HTTP 200 after startup, recreation and restart.

All final integration tests passed.

Source / References:

#306

AI disclosure: OpenAI ChatGPT was used to investigate the issue, develop the patch, prepare test scripts and write the PR description. All Docker builds and tests were executed by the human contributor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

[BUG] Framework cleanup fails with a large number of files

1 participant