-
Notifications
You must be signed in to change notification settings - Fork 28
Remove the default collected output buffer limit and throw an error when the limit is reached #130
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
Remove the default collected output buffer limit and throw an error when the limit is reached #130
Conversation
@@ -70,18 +71,20 @@ extension SubprocessError { | |||
return 6 | |||
case .asyncIOFailed(_): | |||
return 7 | |||
case .failedToSendSignal(_): | |||
case .outputBufferLimitExceeded(_): |
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.
After we set the API we should probably consider the error numbers to be frozen, in case people have written documentation about them or compare them to raw values.
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.
I agree. I'm only doing this because we haven't tagged 0.0.1 yet.
if maxLength != .max { | ||
// If we actually have a max length, attempt to read one | ||
// more byte to determine whether output exceeds the limit | ||
maxLength += 1 |
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.
Does this mean that we've drained 1 more byte from the I/O than the caller expected?
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.
Yes. Unfortunately this is the only way to detect whether there's more data coming. If the caller was only expected N bytes, then the child process should only process N bytes with EOF at the end. If not then we considered this an error.
…hen the limit is reached
2577a37
to
ba88b42
Compare
As discussed in #44 , remove the default output limit since we can't really specify one. Also throw an error if output exits limit.
Resolves: #44