[stream-refactor] BufferedWriter must disconenct Stream, not Protocol
Fix a race where if Stream.on_receive() detects disconnect, it calls Stream.on_disconnect(), which fires Stream 'disconnect' event, whereas if BufferedWriter.on_transmit() detects disconnect, it called Protocol.on_disconnect(), which did not fire the Stream 'disconnect' event. Since mitogen.parent listens on Stream's 'disconnect' event to reap children, this was causing a very difficult to trigger test failure. Triggered after <1000 runs on a Xeon E5530 with hyperthreading using hackbench running at the same priority: $ hackbench -s 1048576 -l 100000000000 -g 4pull/607/head
parent
5f7ab220cb
commit
90c989ee59
Loading…
Reference in New Issue