icinga2 icon indicating copy to clipboard operation
icinga2 copied to clipboard

ApiListener#ListenerCoroutineProc(): get remote endpoint ASAP for logging

Open Al2Klimov opened this issue 1 year ago • 3 comments

On incoming connection timeout we log the remote endpoint which isn't available if it was already disconnected - an exception is thrown. Get it as long as we're still connected not to lose it, nor to get an exception.

ref/IP/48306

This is my alternative implementation for:

closes #9996

Al2Klimov avatar Feb 09 '24 11:02 Al2Klimov

[2024-02-09 12:48:01 +0100] warning/ApiListener: Timeout while processing incoming connection from [::ffff:127.0.0.1]:52311

Still works. 👍

Al2Klimov avatar Feb 09 '24 11:02 Al2Klimov

[2024-02-09 12:48:01 +0100] warning/ApiListener: Timeout while processing incoming connection from [::ffff:127.0.0.1]:52311

Still works. 👍

Have you actually reproduced the problem and it's now working with this PR or does that just mean "still works as before"?

Nonetheless, you are still using the same method, which theoretically can still raise an exception, though was not able to trigger this error, with and without your PR. See also here!

yhabteab avatar Feb 09 '24 12:02 yhabteab

  1. Still works as before.
  2. No, it can't happen even theoretically. I've just accepted the TCP connection, so it is "still" connected.

Al2Klimov avatar Feb 09 '24 12:02 Al2Klimov