On Mon, Apr 27, 2015 at 4:55 PM, Glyph Lefkowitz <glyph@twistedmatrix.com> wrote:

Nothing strikes me as obviously wrong about this code (except the "deferToThread" which seems slightly
suspicious, since nothing in the example appears to have anything to do with threads, and whenever you get threads involved things get complicated).


 The deferToThread just shoves the write of the message string to file into the thread pool. It was added after this issue was observed. Using deferToThread is a hangover from attaching a logging callback when the file wrote, since removed, so callInThread would work also. I didn't want to add the file write onto the reactor thread here. 

I wish I could find a simpler case, but frankly, I have an integration test system that uses a test app to generate upstream messages, and an open source java app to simulate the downstream server. I can't reproduce this there even with all the moving parts.

Happening "in the wild" at one location, was hoping for some advice on troubleshooting what happens between calling transport.write and seeing bytes on the wire. I guess it's time to go digging into parts of twisted I've always taken for granted, and learn something new. ;-)