icinga2
icinga2 copied to clipboard
ApiListener#ListenerCoroutineProc(): get remote endpoint ASAP for logging
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
[2024-02-09 12:48:01 +0100] warning/ApiListener: Timeout while processing incoming connection from [::ffff:127.0.0.1]:52311
Still works. 👍
[2024-02-09 12:48:01 +0100] warning/ApiListener: Timeout while processing incoming connection from [::ffff:127.0.0.1]:52311Still 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!
- Still works as before.
- No, it can't happen even theoretically. I've just accepted the TCP connection, so it is "still" connected.