lordmauve / chopsticks

Chopsticks is an orchestration library: it lets you execute Python code on remote hosts over SSH.
https://chopsticks.readthedocs.io/
Apache License 2.0
158 stars 16 forks source link

Fix buffering issue with python3 and slow hosts (Fixes #52) #53

Closed amigrave closed 7 years ago

amigrave commented 7 years ago

It looks as though the change in Python 3 is that an unbuffered file object opened with fdopen no longer returns exactly size bytes - instead it focuses on only doing one system call.

This patch will prevent to read the stdin first, then reopening the file afterward in bubble.py, instead we dup the file in the bootstrap code and we use the same file descriptor in bubble.py hence we don't need to use an unbuffered stdin anymore.

lordmauve commented 7 years ago

Perfect. Thank you!