Skip to content

do not truncate log files on each LogWriter calls #626

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 2 commits into from
Jun 15, 2025

Conversation

tucksaun
Copy link
Member

We used to have a single concurrent usage of the LogWriter, but this is not the case anymore since b29665f. Because of this, we can lose some logs (the runner ones for instance) as the file is being truncated during the buildCmd call when the LogWrite is fetched.

To fix this, I propose to instantiate the LogWriter once, which will effectively truncate the file only once per server:start launch.

@tucksaun tucksaun requested a review from fabpot June 12, 2025 09:47
@tucksaun tucksaun marked this pull request as draft June 14, 2025 10:31
tucksaun added 2 commits June 15, 2025 09:06
We used to have a single concurrent usage of the `LogWriter`, but this is not the case anymore since b29665f.
Because of this we now loose the runner logs as he file is being truncated during the `buildCmd` call when the LogWrited is fetched.

To fix this i propose to instantiate the LogWriter once which will effectively truncate the file only once per `server:start` launch.
@tucksaun tucksaun force-pushed the fix/no-runner-logs branch from a97d465 to 606fd41 Compare June 15, 2025 07:07
@tucksaun tucksaun marked this pull request as ready for review June 15, 2025 07:08
@fabpot
Copy link
Contributor

fabpot commented Jun 15, 2025

Thank you @tucksaun

@fabpot fabpot merged commit edcf2f8 into symfony-cli:main Jun 15, 2025
2 checks passed
@tucksaun tucksaun deleted the fix/no-runner-logs branch June 15, 2025 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants