Skip to content

Conversation

iCharlesHu
Copy link
Contributor

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

case .asyncIOFailed(_):
return 7
case .failedToSendSignal(_):
case .outputBufferLimitExceeded(_):
Copy link

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.

Copy link
Contributor Author

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
Copy link

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?

Copy link
Contributor Author

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.

@iCharlesHu iCharlesHu force-pushed the charles/buffer-limit-error branch from 2577a37 to ba88b42 Compare July 29, 2025 17:51
@iCharlesHu iCharlesHu merged commit f3f9512 into swiftlang:main Jul 30, 2025
21 checks passed
@iCharlesHu iCharlesHu deleted the charles/buffer-limit-error branch July 30, 2025 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

run appears to be stuck (due to buffer limit?)

3 participants