Browse Source

fixes multi-threaded issue on `__pending` dict (caused due to missing lock on `__pending` dict);

an entry can be deleted by `_delPending` with 1st thread, while 2nd thread in filter doing `_checkPending` where it still got this key in iterator, but later fails in the cycle because `__pending[path]` may be deleted by 1st thread in-between;
closes #3635
pull/3402/merge
sebres 1 year ago
parent
commit
5d9817728d
  1. 2
      fail2ban/server/filterpyinotify.py

2
fail2ban/server/filterpyinotify.py

@ -173,7 +173,9 @@ class FilterPyinotify(FileFilter):
if not chkpath(path): # not found - prolong for next time
if retardTM < 60: retardTM *= 2
if minTime > retardTM: minTime = retardTM
try:
self.__pending[path][0] = retardTM
except KeyError: pass
continue
logSys.log(logging.MSG, "Log presence detected for %s %s",
"directory" if isDir else "file", path)

Loading…
Cancel
Save