Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package salt for openSUSE:Factory checked in 
at 2024-10-31 16:09:20
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/salt (Old)
 and      /work/SRC/openSUSE:Factory/.salt.new.2020 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "salt"

Thu Oct 31 16:09:20 2024 rev:162 rq:1219508 version:3006.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/salt/salt.changes        2024-10-11 
17:01:04.723574861 +0200
+++ /work/SRC/openSUSE:Factory/.salt.new.2020/salt.changes      2024-10-31 
16:09:35.819643848 +0100
@@ -1,0 +2,9 @@
+Thu Oct 17 14:02:57 UTC 2024 - Marek Czernek <marek.czer...@suse.com>
+
+- Handle logger exception when flushing already closed file
+- Include passlib as a recommended dependency
+
+- Added:
+  * handle-logger-flushing-already-closed-file-686.patch
+
+-------------------------------------------------------------------

New:
----
  handle-logger-flushing-already-closed-file-686.patch

BETA DEBUG BEGIN:
  New:- Added:
  * handle-logger-flushing-already-closed-file-686.patch
BETA DEBUG END:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ salt.spec ++++++
--- /var/tmp/diff_new_pack.X1kebJ/_old  2024-10-31 16:09:40.307832195 +0100
+++ /var/tmp/diff_new_pack.X1kebJ/_new  2024-10-31 16:09:40.311832363 +0100
@@ -452,6 +452,8 @@
 Patch144:       fix-x509-private-key-tests-and-test_suse-on-sle12-68.patch
 # PATCH-FIX_OPENSUSE: https://github.com/openSUSE/salt/pull/685
 Patch145:       enhance-cleanup-mechanism-after-salt-bundle-upgrade-.patch
+# PATCH-FIX_UPSTREAM: 
https://github.com/saltstack/salt/commit/9683260d61668da8559ecde6caf63a52fedd8790
+Patch146:       handle-logger-flushing-already-closed-file-686.patch
 
 ### IMPORTANT: The line below is used as a snippet marker. Do not touch it.
 ### SALT PATCHES LIST END
@@ -649,6 +651,7 @@
 Requires:       sudo
 Requires:       file
 Recommends:     man
+Recommends:     python3-passlib
 
 Provides:       bundled(python3-tornado) = 4.5.3
 

++++++ _lastrevision ++++++
--- /var/tmp/diff_new_pack.X1kebJ/_old  2024-10-31 16:09:40.395835888 +0100
+++ /var/tmp/diff_new_pack.X1kebJ/_new  2024-10-31 16:09:40.399836056 +0100
@@ -1,3 +1,3 @@
-af4efe8013e54de4be818761003c5966c88b6c19
+e1eca529a18f7fde5ceec0e3d9524028c7affd12
 (No newline at EOF)
 

++++++ handle-logger-flushing-already-closed-file-686.patch ++++++
>From e23dce108588a9c52d3f7542636892750d6efcbd Mon Sep 17 00:00:00 2001
From: Marek Czernek <marek.czer...@suse.com>
Date: Thu, 17 Oct 2024 15:52:00 +0200
Subject: [PATCH] Handle logger flushing already closed file (#686)

This is a partial cherry-pick of
https://github.com/saltstack/salt/commit/9683260d61668da8559ecde6caf63a52fedd8790
---
 salt/_logging/handlers.py |  4 ++++
 salt/_logging/impl.py     | 10 +++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/salt/_logging/handlers.py b/salt/_logging/handlers.py
index 5a1a1613137..d8bc68a49db 100644
--- a/salt/_logging/handlers.py
+++ b/salt/_logging/handlers.py
@@ -95,6 +95,9 @@ class DeferredStreamHandler(StreamHandler):
         super().__init__(stream)
         self.__messages = deque(maxlen=max_queue_size)
         self.__emitting = False
+        import traceback
+
+        self.stack = "".join(traceback.format_stack())
 
     def handle(self, record):
         self.acquire()
@@ -116,6 +119,7 @@ class DeferredStreamHandler(StreamHandler):
                 super().handle(record)
             finally:
                 self.__emitting = False
+        # This will raise a ValueError if the file handle has been closed.
         super().flush()
 
     def sync_with_handlers(self, handlers=()):
diff --git a/salt/_logging/impl.py b/salt/_logging/impl.py
index 4d1ebd2495f..9d76c3174e2 100644
--- a/salt/_logging/impl.py
+++ b/salt/_logging/impl.py
@@ -488,7 +488,15 @@ def setup_temp_handler(log_level=None):
             break
     else:
         handler = DeferredStreamHandler(sys.stderr)
-        atexit.register(handler.flush)
+
+        def tryflush():
+            try:
+                handler.flush()
+            except ValueError:
+                # File handle has already been closed.
+                pass
+
+        atexit.register(tryflush)
     handler.setLevel(log_level)
 
     # Set the default temporary console formatter config
-- 
2.47.0

Reply via email to