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

Blocks network if writing to child stdin blocks #9

Closed
2 tasks
lspitzner opened this issue Mar 4, 2020 · 3 comments
Closed
2 tasks

Blocks network if writing to child stdin blocks #9

lspitzner opened this issue Mar 4, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@lspitzner
Copy link

With createProcess, afaict, input events end up being performEvented directly. If the child process is busy and does not consume input in time, writing to its stdin handle may block. That happens in

https://github.com/reflex-frp/reflex-process/blob/develop/src/Reflex/Process.hs#L138

and

https://github.com/reflex-frp/reflex-process/blob/develop/src/Reflex/Process.hs#L81-L82

with no forkIO in sight. This most likely blocks the network entirely.

Desired behaviour:

  • Do not block network in parent because child is slow
  • Keep messages in proper order (this rules out a plain forkIO to send the messages. Even if hPutStr was threadsafe)
@3noch 3noch added the bug Something isn't working label Mar 12, 2020
@3noch
Copy link
Member

3noch commented Mar 12, 2020

Thanks for the report!

We need to fork a single writing thread as soon as the process is forked. Then the event would write to some sort of channel which is consumed by the writer. This suffers from unbounded memory, however.

@3noch 3noch added the good first issue Good for newcomers label Mar 12, 2020
@3noch
Copy link
Member

3noch commented Mar 12, 2020

We may not be able to get to this for a while; feel free to beat us to it!

@3noch
Copy link
Member

3noch commented May 8, 2020

Fixed by #11

@3noch 3noch closed this as completed May 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants