Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: cleanup temporary directories#566

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 5 commits intosymfony-cli:mainfromtucksaun:fix/553
Feb 14, 2025
Merged

Conversation

@tucksaun
Copy link
Member

@tucksauntucksaun commentedFeb 8, 2025
edited
Loading

Fixes#383
Fixes#553

It also seems logical to work on cleaning any temporary directory while working on cleaning the~/.symfony5/tmp directory so this is a slightly bigger PR.
The second commit can extracted though if we want to focus on a single directory for now.

$ find~/.symfony5/{tmp,var,log} -type d -mindepth 1 -maxdepth 1| wc -l       0$~/Work/src/github.com/symfony-cli/symfony-cli/symfony-cli server:start [WARNING] Thelocal web server is optimizedforlocal development and MUST never be usedin a production setup. [WARNING] Please note that the Symfony CLI only listens on 127.0.0.1 by default since version 5.10.3.           You can use the --allow-all-ip or --listen-ip flags to change this behavior. [OK] Web server listening      The Web server is using PHP FPM 8.4.3      https://127.0.0.1:8000Stream the logs via symfony-cli server:log$ find~/.symfony5/{tmp,var,log} -type d -mindepth 1 -maxdepth 1| wc -l       3$~/Work/src/github.com/symfony-cli/symfony-cli/symfony-cli server:stopStopping PHP-FPMStopping Web Server [OK] Stopped 2 process(es) successfully$ find~/.symfony5/{tmp,var,log} -type d -mindepth 1 -maxdepth 1| wc -l       0

Unfortunately cleaning up previoustmp directories does not seem like a good idea because they can still be in-use.

@tucksauntucksaun changed the titleFix/553fix: cleanup temporary directoriesFeb 8, 2025
_=os.MkdirAll(filepath.Dir(path),0755)
}
returnpath
returnfilepath.Join(p.tempDir,fmt.Sprintf("%s-router.php",p.Version.Version))
Copy link
MemberAuthor

@tucksauntucksaunFeb 8, 2025
edited
Loading

Choose a reason for hiding this comment

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

Note for the reviewers: I moved the routing file to the same location as the FPM config.
This way I can always create and clean the directory no matter the SAPI

fabpot reacted with thumbs up emoji
Copy link
Contributor

@fabpotfabpot left a comment

Choose a reason for hiding this comment

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

Regarding cleaning up existing empty directories, can we at least remove the ones that are older than x days?

@tucksaun
Copy link
MemberAuthor

Regarding cleaning up existing empty directories, can we at least remove the ones that are older than x days?

good idea, will do

tucksaunand others added2 commitsFebruary 14, 2025 05:54
Co-authored-by: Fabien Potencier <fabien@potencier.org>
please note that this might take a while because we clean by batches, use `find ~/.symfony5/tmp -type d -mindepth 1 -maxdepth 1 -delete` if you are eager
@tucksaun
Copy link
MemberAuthor

@fabpot cleanup added. I considered directories as stale after 7 days. wdyt?

@fabpotfabpot merged commit6004fc6 intosymfony-cli:mainFeb 14, 2025
1 check passed
@fabpot
Copy link
Contributor

Great! Thank you.

@tucksauntucksaun deleted the fix/553 branchFebruary 14, 2025 14:48
@srsbiz
Copy link

srsbiz commentedFeb 15, 2025
edited
Loading

Thanks, unfortunately it is somehow not working for me. Are old files removed only on "clean" shutdown of the server? I cannot gracefully stop server withserver:stop since#397 and while force shutting down with Ctrl+C there is some attempt to remove logs, but it almost always fail
image
Error message says that file is used by another process and cannot be accessed

@tucksaun
Copy link
MemberAuthor

AFAICT this error is not related to this PR and is only related to#397 (on which I didn't had the opportunity to work so far)

@srsbiz
Copy link

Yes, my question is not about this error, but on conditions required for cleanup process to be performed - if it requires "clean" shutdown by callingserver:stop or if should be performed on any type of shutdown - like Ctrl+C, stopping process via Task Manager, issuingkill command with pid etc.

@tucksaun
Copy link
MemberAuthor

On any shutdown. But your error happens during the shutdown process and things are not necessarily linear in Go so your error might end up stopping the cleaning process early on

@tucksaun
Copy link
MemberAuthor

@srsbiz see#569 for an attempt to improve this for you (won't fix the initial error)

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

Reviewers

@fabpotfabpotAwaiting requested review from fabpot

Assignees

No one assigned

Labels

None yet

Milestone

No milestone

3 participants

@tucksaun@fabpot@srsbiz

[8]ページ先頭

©2009-2025 Movatter.jp