-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle large stdout and stderr lines from scripts #70
Conversation
Currently if a script outputs a single line to stdout or stderr over 16k characters the script is stopped with a pipe error. When used in combination with shell scripts this makes for a very confusing error state where output is just limited or the process either hangs or fails without explanation. This change replaces the shell executer based on github.com/go-cmd/cmd with one using the standard libraries os/exec package. Further more the line buffer limit is increased to 512k characters. go-cmd does not support changing the maximum line length so the library cannot support our use case. This bug was found when a Go service was testing an HTML template. The test would output the rendered HTML template and a complex SVG exceeded the current 16k limit. This resulted in the test being marked as successfull by the Go toolchain but as the stdout pipe was broken shell scripts would not work as intended.
I think this might break up the order of script's stdout and stderr. Hold on... |
A couple of issues with this implementation. Using I'll have to give it some more work before its ready. Closing until then. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome
This change partially reverts 48c5180 (#70) which fixed an issue where large outputs from shell scripts would break output pipes (#90). The change replaced go-cmd with a native implementation which on the surface fixed the large output bug but introduced another subtle race condition in the output of scripts. The motivation in the original commit for replacing go-cmd was the missing ability to configure the output buffers size. That feature is now available in go-cmd why this change set reverts to use the proven go-cmd implementation. This removes a lot of complexity from shuttle while also fixing the race condition identified in #90.
This change partially reverts 48c5180 (#70) which fixed an issue where large outputs from shell scripts would break output pipes (#90). The change replaced go-cmd with a native implementation which on the surface fixed the large output bug but introduced another subtle race condition in the output of scripts. The motivation in the original commit for replacing go-cmd was the missing ability to configure the output buffers size. That feature is now available in go-cmd why this change set reverts to use the proven go-cmd implementation. This removes a lot of complexity from shuttle while also fixing the race condition identified in #90.
This change partially reverts 48c5180 (#70) which fixed an issue where large outputs from shell scripts would break output pipes (#90). The change replaced go-cmd with a native implementation which on the surface fixed the large output bug but introduced another subtle race condition in the output of scripts. The motivation in the original commit for replacing go-cmd was the missing ability to configure the output buffers size. That feature is now available in go-cmd why this change set reverts to use the proven go-cmd implementation. This removes a lot of complexity from shuttle while also fixing the race condition identified in #90.
Currently if a script outputs a single line to stdout or stderr over 16k
characters the script is stopped with a pipe error. When used in combination
with shell scripts this makes for a very confusing error state where output is
just limited or the process either hangs or fails without explanation.
This change replaces the shell executer based on github.com/go-cmd/cmd with one
using the standard libraries os/exec package. Further more the line buffer limit
is increased to 512k characters.
go-cmd does not support changing the maximum line length so the library cannot
support our use case.
This bug was found when a Go service was testing an HTML template. The test
would output the rendered HTML template and a complex SVG exceeded the current
16k limit. This resulted in the test being marked as successfull by the Go
toolchain but as the stdout pipe was broken shell scripts would not work as
intended.