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

Handle logger flushing already closed file #686

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

m-czernek
Copy link
Contributor

@m-czernek m-czernek commented Oct 16, 2024

This is a partial cherry-pick of
saltstack/salt@9683260

Note: Test failures are unrelated, fixed with openSUSE/salt-packaging#100

What does this PR do?

Fixes intermittent test failures.

What issues does this PR fix or reference?

Related to https://github.com/SUSE/spacewalk/issues/23286

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

Copy link
Contributor

@vzhestkov vzhestkov left a comment

Choose a reason for hiding this comment

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

In general looks good to me. Just one question inline.

@@ -116,6 +119,7 @@ def flush(self):
super().handle(record)
finally:
self.__emitting = False
# This will raise a ValueError if the file handle has been closed.
super().flush()
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering why they haven't tried to catch this exception here, as in any case it should be ok just to hide it, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had the same thought, but it's a cherry-pick, so I used upstream's code...

@m-czernek m-czernek merged commit e23dce1 into openSUSE:openSUSE/release/3006.0 Oct 17, 2024
6 of 8 checks passed
@m-czernek m-czernek deleted the logging-fix branch October 17, 2024 13:52
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.

2 participants