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

Pipe objects have lost their asyncness #24717

Open
Keno opened this issue Nov 23, 2017 · 3 comments
Open

Pipe objects have lost their asyncness #24717

Keno opened this issue Nov 23, 2017 · 3 comments
Assignees
Labels
io Involving the I/O subsystem: libuv, read, write, etc.

Comments

@Keno
Copy link
Member

Keno commented Nov 23, 2017

It looks like Pipe objects may have list their async-ness somewhere along the way:

link_pipe(stdio)

This creates a non-async (thread-blocking) pipe that's safe for spawning but not really meant for julia-side I/O. The original design here was to pass an unitialized PipeEndpoint, but that got broken in 2fdc182 (now throws an error if you attempt to do anything with it). Looking back, the uninitialized Pipe object API seems fine, but an uninitialized PipeEndpoint does not, because it switches which of the endpoints it refers to depending on whether it's initialized or not.

It would be good to look into whether we can get rid of the spawn-safe distinction. That'd probably be the easiest way to deal with this.

@Keno Keno added the io Involving the I/O subsystem: libuv, read, write, etc. label Nov 23, 2017
@Keno Keno added this to the 1.0 milestone Nov 23, 2017
@Keno Keno assigned Keno and vtjnash Nov 23, 2017
@Keno
Copy link
Member Author

Keno commented Nov 23, 2017

@vtjnash has indicated that he's working on libuv updates that'll change these considerations. Getting rid of the spawn-safe distinction seems infeasible. The current situation is quite bad though, since spawn-safe-pipe-io is thread blocking. The long term solution seems to be to offload pipe i/o to a worker thread if it's not async. At the very least, for 1.0, we need to think about whether we need to make any breaking changes to the API and we should make sure that the pipes we get from open are async.

@samoconnor
Copy link
Contributor

Related: #24526

@JeffBezanson
Copy link
Member

We think this is really just a bug, since it's a case that causes the process to block when it shouldn't.

@JeffBezanson JeffBezanson modified the milestones: 1.0, 1.0.x Jan 25, 2018
@DilumAluthge DilumAluthge removed this from the 1.x.y milestone Mar 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
io Involving the I/O subsystem: libuv, read, write, etc.
Projects
None yet
Development

No branches or pull requests

5 participants