[Twisted-Python] sharing a dict between child processes

Glyph glyph at twistedmatrix.com
Thu Nov 7 16:39:40 MST 2019



> On Nov 7, 2019, at 2:07 AM, Scott, Barry <barry.scott at forcepoint.com> wrote:
> 
> On Thursday, 7 November 2019 05:29:34 GMT Sean DiZazzo wrote:
>> If you need guaranteed delivery of the data, why not just use a TCP
>> connection to the unix socket, instead of a UDP connection which inherently
>> can lose data?  In that case I don't think your patch would be needed.
>> 
>> I didn't look at the source, so perhaps I missed something.
> 
> UDS is not UDP. 

Specifically, a UNIX datagram socket is a datagram-based IPC mechanism but unlike UDP it is not unreliable.  You can still get EAGAIN or EMSGSIZE because buffers fill up and datagrams are too big, but if you put a datagram in, it comes out again.  Barry's (embarrassingly long-standing) bug in Twisted's handling of UDS failures is here: https://twistedmatrix.com/trac/ticket/9504 <https://twistedmatrix.com/trac/ticket/9504> .

You can't make "a TCP connection" to a UNIX-domain socket; TCP is a thing you do over networks and the UNIX address family is for local inter-process communication on a single host.

>>> We use the UDS (Unix domain sockets) to talk to a master process.
>>> Twisted has support for this. But you need a small patch to avoid data
>>> lose.
>>> 
>>> UDS does not lose data and is message based, not bytes based. We
>>> use pickle to encode requests and responses.
> 
> Barry
> 
> 
> 
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20191107/efce3f05/attachment-0002.html>


More information about the Twisted-Python mailing list