Skip to content
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

gh-94026: Workaround for BlockingIOError in runtest_mp on Emscripten #94164

Closed
wants to merge 1 commit into from

Conversation

tiran
Copy link
Member

@tiran tiran commented Jun 23, 2022

runtest_mp test worker now handles :exc:BlockingIOError to work around
non-blocking pipes on Emscripten.

@tiran tiran added tests Tests in the Lib/test dir needs backport to 3.11 only security fixes labels Jun 23, 2022
@tiran
Copy link
Member Author

tiran commented Jun 23, 2022

@vstinner @serhiy-storchaka please take a look. I know that you enjoy I/O shenanigans :)

…ipten

`runtest_mp` test worker now handles :exc:`BlockingIOError` to work around
non-blocking pipes on Emscripten.
"""
data = data.encode(stream.encoding)
# flush buffers, just in case
stream.flush()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can fail here.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A pipe can block. If you want to avoid errors when writing into a pipe: use a temporary named file instead.

@tiran
Copy link
Member Author

tiran commented Jun 23, 2022

A blocking pipe would not be an issue. The problem is that Emscripten on NodeJS uses a non-blocking pipe for standard streams.

@tiran
Copy link
Member Author

tiran commented Jun 26, 2022

Closing in favor of approach #94253

@tiran tiran closed this Jun 26, 2022
@tiran tiran added DO-NOT-MERGE and removed needs backport to 3.11 only security fixes labels Jun 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants