Skip to content

Commit

Permalink
Services: Unbound DNS - likely locking issue in https://forum.opnsens…
Browse files Browse the repository at this point in the history
…e.org/index.php?topic=35527.0 , concurrent session closing the handle while still writing data.
  • Loading branch information
AdSchellevis committed Aug 24, 2023
1 parent 6487512 commit 7406a50
Showing 1 changed file with 7 additions and 6 deletions.
Expand Up @@ -196,12 +196,13 @@ def _try_open_pipe(self):

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:
Expand Down

0 comments on commit 7406a50

Please sign in to comment.