agdsn / pycroft

The AG DSN management system
Apache License 2.0
20 stars 9 forks source link

Handle builtins.TimeoutError as well in hades logs #514

Open agdsn-sentry[bot] opened 2 years ago

agdsn-sentry[bot] commented 2 years ago

Sentry Issue: PYCROFT-33

TimeoutError: [Errno 110] Connection timed out
(19 additional frame(s) were not displayed)
...
  File "kombu/transport/pyamqp.py", line 169, in drain_events
    return connection.drain_events(**kwargs)
  File "amqp/connection.py", line 523, in drain_events
    while not self.blocking_read(timeout):
  File "amqp/connection.py", line 528, in blocking_read
    frame = self.transport.read_frame()
  File "amqp/transport.py", line 299, in read_frame
    frame_header = read(7, True)
  File "amqp/transport.py", line 628, in _read
    s = recv(n - len(rbuf))
lukasjuhrich commented 2 years ago

In this exception handling logic https://github.com/agdsn/pycroft/blob/85695aa0ebd80accd7eb4e57076e1603847c0939/hades_logs/__init__.py#L131-L145

we need to add a case for python-builtin TimeoutError, which appearently is not catched and re-thrown everywhere in the kombu transport logic.

The purpose of this improvement is to show a „timed out“ error message instead of throwing a 500, just like we already do in the other cases.