mirror of
https://github.com/fail2ban/fail2ban.git
synced 2026-03-11 08:55:31 +00:00
errors on closed socket are too sporadic to cover it (prevents "coverage decreased" over and over again)
This commit is contained in:
parent
5ff63b66a0
commit
ef975307c4
1 changed files with 4 additions and 2 deletions
|
|
@ -138,13 +138,15 @@ def loop(active, timeout=None, use_poll=False):
|
|||
break
|
||||
errCount += 1
|
||||
if errCount < 20:
|
||||
if e.args[0] in (errno.ENOTCONN, errno.EBADF): # (errno.EBADF, 'Bad file descriptor')
|
||||
# errno.ENOTCONN - 'Socket is not connected'
|
||||
# errno.EBADF - 'Bad file descriptor'
|
||||
if e.args[0] in (errno.ENOTCONN, errno.EBADF): # pragma: no cover (too sporadic)
|
||||
logSys.info('Server connection was closed: %s', str(e))
|
||||
else:
|
||||
logSys.error('Server connection was closed: %s', str(e))
|
||||
elif errCount == 20:
|
||||
logSys.info('Too many errors - stop logging connection errors')
|
||||
logSys.exception(e)
|
||||
logSys.error('Too many errors - stop logging connection errors')
|
||||
|
||||
|
||||
##
|
||||
|
|
|
|||
Loading…
Reference in a new issue