iobio / minion

Server wrapper that turns command line tools into web services
MIT License
60 stars 9 forks source link

Fixed the truncation bug that long haunted us #13

Closed yiq closed 8 years ago

yiq commented 8 years ago

Culprit: output stream does not need to be closed manually Since the program's stdout is piped to output stream, nodejs will properly handle the closing of the stream when data in stdout pipe is consumed. Capturing either the 'close', or the 'exit' event of the running program, and close stream manually, will cause the stream to be closed too early while data still sits in Linux pipe buffer, especially under heavy load, and causes truncation to occur.