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

Fix the implementation of closewrite(::AbstractPipe) #57140

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JamesWrigley
Copy link
Contributor

Previously this would just call closewrite(p.in), which would throw an exception since closewrite isn't supported for the libuv stream underlying PipeEndpoint.

This fixes the example in the Pipe docstring: https://docs.julialang.org/en/v1/base/io-network/#Base.Pipe

Previously this would just call `closewrite(p.in)`, which would throw an
exception since `closewrite` isn't supported for the libuv stream underlying
`PipeEndpoint`.
@JamesWrigley
Copy link
Contributor Author

AFAICT the test and build failures are unrelated.

Copy link
Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

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

The function close is not generally equivalent to closewrite, so it cannot just replace one with the other. We can potentially make closewrite more robust however

@JamesWrigley
Copy link
Contributor Author

I'm not sure I follow, isn't closing the write end of a Pipe exactly what closewrite should do? What else would need to be done?

@vtjnash
Copy link
Member

vtjnash commented Jan 23, 2025

The shutdown syscall has expected side-effects whenever the user has a socket there (sends an EOF explicitly, even if other kernel handles exist) and doesn't destroy the read side of the handle if that happens to also be present

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants