logging.handlers.SocketHandler

writeson doug.farrell at gmail.com
Mon Mar 9 10:10:10 EDT 2009


Vinay,

I did as you suggested and everything seemed to work; client programs
were able to reconnect to the servers and log messages started showing
up soon after the logging server was running again. I did this with my
Twisted client/server setup and it showed the same behavior; clients
reconnected to the server after a short delay. Messages were dropped
while the server was down, but that was what I expected. This makes it
look like I raised a "false alarm" and the
logging.handlers.SocketHandler is behaving as expected, and it is more
likely there is a problem in my application.

My manager is suggesting that the underlying problem is using TCP
rather than UDP (SocketHandler vs DatagramHandler) for logging from
clients to the logging server. His assertion is that using TCP would
guarantee the loss of 2 messages at the logging server from an
attached daemon before a reconnect was established. I don't know
enough about network protocols to determine if this is true or not,
but the reading I've done about UDP talks about UDP being an
unreliable protocol, so I'm not sure how using it would change the
loss of 2 or more messages while a reconnect occurs. Perhaps because
it is stateless and doesn't have to re-establish a connection? I'm not
sure, what are your thoughts?

Again, thanks for your help and support,
Doug
On Mar 6, 1:35 pm, Vinay Sajip <vinay_sa... at yahoo.co.uk> wrote:
> On Mar 6, 4:09 pm, writeson <doug.farr... at gmail.com> wrote:
>
> This would appear to indicate that the problem is to do with how
> Twisted is being used. A couple of avenues to explore would be:
>
> 1. Try the simple test client I suggested with your Twisted server and
> see what happens. If stuff comes through when the server is restarted,
> that would appear to isolate the problem to somewhere in your client
> daemons (at least as a working hypothesis).
>
> 2. Try the Twisted client daemons with the simple server from the
> logging docs. If stuff comes through when the server is restarted,
> then the problem might be with your Twisted server daemon.
>
> Of course, it may be necessary to modify the simple seem-to-work test
> scripts to accommodate whatever specific wire format is being used in
> your problem scenario.
>
> If either of these experiments yield some more information, it's
> probably worth taking that to the Twisted community, perhaps the
> twisted-python mailing list.
>
> Regards,
>
> Vinay Sajip




More information about the Python-list mailing list