Quiet socket.timeout: timed out
Closed this issue · 3 comments
lrivallain commented
socket.timeout are raising traceback: quiet them by catching the error:
Traceback (most recent call last):
File "XXXlib/python3.7/site-packages/amqp/transport.py", line 125, in _connect
host, port, family, socket.SOCK_STREAM, SOL_TCP)
File "/usr/lib/python3.7/socket.py", line 748, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -9] Address family for hostname not supported
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "XXXlib/python3.7/site-packages/kombu/utils/functional.py", line 332, in retry_over_time
return fun(*args, **kwargs)
File "XXXlib/python3.7/site-packages/kombu/connection.py", line 261, in connect
return self.connection
File "XXXlib/python3.7/site-packages/kombu/connection.py", line 802, in connection
self._connection = self._establish_connection()
File "XXXlib/python3.7/site-packages/kombu/connection.py", line 757, in _establish_connection
conn = self.transport.establish_connection()
File "XXXlib/python3.7/site-packages/kombu/transport/pyamqp.py", line 130, in establish_connection
conn.connect()
File "XXXlib/python3.7/site-packages/amqp/connection.py", line 302, in connect
self.transport.connect()
File "XXXlib/python3.7/site-packages/amqp/transport.py", line 79, in connect
self._connect(self.host, self.port, self.connect_timeout)
File "XXXlib/python3.7/site-packages/amqp/transport.py", line 136, in _connect
"failed to resolve broker hostname"))
File "XXXlib/python3.7/site-packages/amqp/transport.py", line 149, in _connect
self.sock.connect(sa)
socket.timeout: timed out
lrivallain commented
Same for :
Traceback (most recent call last):
File "XXXlib/python3.7/site-packages/kombu/mixins.py", line 170, in run
for _ in self.consume(limit=None, **kwargs):
File "XXXlib/python3.7/site-packages/kombu/mixins.py", line 192, in consume
conn.drain_events(timeout=safety_interval)
File "XXXlib/python3.7/site-packages/kombu/connection.py", line 301, in drain_events
return self.transport.drain_events(self.connection, **kwargs)
File "XXXlib/python3.7/site-packages/kombu/transport/pyamqp.py", line 103, in drain_events
return connection.drain_events(**kwargs)
File "XXXlib/python3.7/site-packages/amqp/connection.py", line 500, in drain_events
while not self.blocking_read(timeout):
File "XXXlib/python3.7/site-packages/amqp/connection.py", line 505, in blocking_read
frame = self.transport.read_frame()
File "XXXlib/python3.7/site-packages/amqp/transport.py", line 250, in read_frame
frame_header = read(7, True)
File "XXXlib/python3.7/site-packages/amqp/transport.py", line 430, in _read
s = recv(n - len(rbuf))
ConnectionResetError: [Errno 104] Connection reset by peer
lrivallain commented
looks like it could be managed in kombu/mixins.py
:
157c157
< warn(W_CONN_ERROR, interval, exc, exc_info=1)
---
> warn(W_CONN_ERROR, interval, exc, exc_info=0)
175c175
< warn(W_CONN_LOST, exc_info=1)
---
> warn(W_CONN_LOST, exc_info=0)
With this change: not traceback is printed: only logger.
lrivallain commented
Upstream issue that may be fixed by: celery/kombu#1000