mirror of https://github.com/fail2ban/fail2ban
errors on closed socket are too sporadic to cover it (prevents "coverage decreased" over and over again)
parent
5ff63b66a0
commit
ef975307c4
|
@ -138,13 +138,15 @@ def loop(active, timeout=None, use_poll=False):
|
||||||
break
|
break
|
||||||
errCount += 1
|
errCount += 1
|
||||||
if errCount < 20:
|
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))
|
logSys.info('Server connection was closed: %s', str(e))
|
||||||
else:
|
else:
|
||||||
logSys.error('Server connection was closed: %s', str(e))
|
logSys.error('Server connection was closed: %s', str(e))
|
||||||
elif errCount == 20:
|
elif errCount == 20:
|
||||||
logSys.info('Too many errors - stop logging connection errors')
|
|
||||||
logSys.exception(e)
|
logSys.exception(e)
|
||||||
|
logSys.error('Too many errors - stop logging connection errors')
|
||||||
|
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|
Loading…
Reference in New Issue