Services: Unbound DNS - likely locking issue in https://forum.opnsense.org/index.php?topic=35527.0 , concurrent session closing the handle while still writing data.

This commit is contained in:
Ad Schellevis 2023-08-24 08:39:16 +02:00
parent 6487512a8e
commit 7406a5067f

View File

@ -196,12 +196,13 @@ class Logger:
def close(self):
if self.stats_enabled:
if self._pipe_fd is not None:
os.close(self._pipe_fd)
try:
os.unlink(self._pipe_name)
except:
pass
with self._lock:
if self._pipe_fd is not None:
os.close(self._pipe_fd)
try:
os.unlink(self._pipe_name)
except:
pass
def log_entry(self, query: Query):
if not self.stats_enabled: