Skip to content
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

Perform file roll only occasionally when file is locked #3684

Merged
merged 1 commit into from
May 30, 2022

Conversation

nohwnd
Copy link
Member

@nohwnd nohwnd commented May 26, 2022

Description

When the log file becomes bigger than the roll limit and is opened in editor it becomes locked, and we try to move it twice on every message. This avoids rolling it for 1 minute since we last tried and failed.

Related issue

Fix #3413

Copy link
Member

@Evangelink Evangelink left a comment

Choose a reason for hiding this comment

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

What happens to the traces performed in between the rolling?

Could we use something mockable instead of Stopwatch and add some tests for this behavior?

@nohwnd
Copy link
Member Author

nohwnd commented May 27, 2022

Nothing happens to them, they will continue being written into the file, same as they did before. We just don't attempt to move the file on every line we write, and bring performance to halt.

Feel free to be the other person in your "we" and add as many unit tests as you want 😁

@Evangelink Evangelink merged commit 429af98 into microsoft:main May 30, 2022
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.

Rolling file trace listener slows down significantly when the file is in use
2 participants