On 30/04/2013, at 3:45 AM, Justin Clift wrote: > On 29/04/2013, at 11:00 PM, Jeff Darcy wrote: >> On 04/29/2013 12:23 PM, Justin Clift wrote: >>> Tried establishing a tcp connection during the translator _init_, then >>> re-using it for every fop invocation. The very first time invovation >>> works, which likely executes the init code too. Everything after that >>> though gives "broken pipe" errors: >>> >>> ERROR: Error received at msg.sendall() time: [Errno 32] Broken pipe >>> >>> Code here, if it's helpful: >>> >>> https://github.com/justinclift/glupy/blob/glusterflow_sharing/glusterflowclient.py >>> >>> On IRC, Kaleb mentioned it just might be how this works. i.e. Python >>> closing all connections at the end of each invocation >> >> That doesn't quite make sense to me. AIUI, the C part of the code >> should still have a borrowed reference to the Translator object from >> PyObject_CallObject, so it shouldn't be deleted. If not, that's easy to >> fix. However, even if that were the case, __init__ would be called on >> the new object and things would still work (albeit inefficiently). Have >> you verified that __init__ is in fact being called multiple times? If >> not, then it's a different kind of problem that we'll need to figure out. Actually, let me clarify things as I understand them, just in case it helps. The translator __init__ in my Glupy module seems to be called just once, when the vol file is loaded. Basing that on the statements I used to have in it like: print 'In translator __init__() function' That would only turn up in the output once (when loading vol file), whereas the fop functions (ie lookup_fop()) are definitely called once per operation. (this is why it seemed like a good idea to initialise the tcp connection once in init, and then reuse it in the fop() functions) Does that help? + Justin -- Open Source and Standards @ Red Hat twitter.com/realjustinclift