[issue40352] SocketHandler silently drops log messages on re-connect

2020-10-14 Thread Oleg Nykolyn
Oleg Nykolyn added the comment: There are multiple servers running in Kubrnetes cluster - API servers based on Django, celery workers, etc. All of them send logs to AWS TCP balancer, which acts as balancer for vector service[1], which send logs to Elasticsearch. Basically we have following

[issue40352] SocketHandler silently drops log messages on re-connect

2020-09-13 Thread Vinay Sajip
Vinay Sajip added the comment: @Oleg In the interests of clarity, can you please give more detail about the network topology and sequence of events in your use case? Where the machine with the SocketHandler is, where the socket server is that it's sending to, where the TCP balancer comes

[issue40352] SocketHandler silently drops log messages on re-connect

2020-09-02 Thread Vinay Sajip
Vinay Sajip added the comment: > It is enough to reopen the socket and send the current message again. A common reason for connection failure in SocketHandler is the other end going offline for some reason. The offline period can often be measured in seconds to hours, or even longer. The

[issue40352] SocketHandler silently drops log messages on re-connect

2020-09-02 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +21151 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22061 ___ Python tracker

[issue40352] SocketHandler silently drops log messages on re-connect

2020-09-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In this particular case we do not need a buffer. It is enough to reopen the socket and send the current message again. -- ___ Python tracker

[issue40352] SocketHandler silently drops log messages on re-connect

2020-09-01 Thread Vinay Sajip
Vinay Sajip added the comment: > But when we use TCP it is expected that log messages will not be lost. I wouldn't go that far: logging is not a primary program function (i.e. the library or application should work exactly the same if logging were to be disabled). For the situation where

[issue40352] SocketHandler silently drops log messages on re-connect

2020-04-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If sending log messages is not guaranteed, we could use UDP. But when we use TCP it is expected that log messages will not be lost. -- nosy: +serhiy.storchaka ___ Python tracker

[issue40352] SocketHandler silently drops log messages on re-connect

2020-04-21 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: On one hand it's bad messages get lost, one the other retrying to send the message would take a lot of time and make `SocketHandler` very slow. Maybe we could had the record to a very short queue so we can retry to send it with the next message? --

[issue40352] SocketHandler silently drops log messages on re-connect

2020-04-21 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +vinay.sajip ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40352] SocketHandler silently drops log messages on re-connect

2020-04-21 Thread Oleg Nykolyn
New submission from Oleg Nykolyn : Hi, I've faced this issue when using logging.handlers.SocketHandler AWS TCP balancer. AWS balancer uses 60 second time-out by default (max 4000s), thus resulting in lots of closed sockets during inactive periods. SocketHandler.send() drops current message