cespare / reflex

Run a command when files change
MIT License
3.35k stars 135 forks source link

Avoid stucking while reading stdout from pty #83

Closed tomoemon closed 3 years ago

tomoemon commented 3 years ago

NewScanner is unable to read lines that exceed 64*1024 bytes in length, resulting in an error. However, reflex ignores Scan errors, so when the command being executed produces a large output, reflex will block and the command itself will stop.

By using ReadLine, it is possible to divide the output into multiple reads even if it is large.

flexoid commented 3 years ago

Please merge it if possible 🙏

Just spent 3 hours trying to figure out why my service hangs on a completely unexpected point. But it actually didn't hang, it was just silence in stdout because of this bug.

cespare commented 3 years ago

I fixed this in a different way in 13e5691dcde5f7c29c144d1cb8c34f453d78505d and tagged v0.3.1.