-
Notifications
You must be signed in to change notification settings - Fork 57
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
connector-proxy: make stdin/stdout streams independent to avoid deadlocks #628
Comments
I looked into this today, apparently there is no way in Rust standard library to close stdout of the process (see rust-lang/rust#40032), however it is possible by closing fd In this case the best practice is to close the fd and immediately request opening Note that The code will roughly look like this (not tested): let rc = unsafe {
libc::freopen("/dev/null", "w", libc::fopen(libc::STDOUT_FILENO, "r"))
};
if rc == -1 {
Ok(())
} else {
Err(CloseError { previous: io::Error::last_os_error(), file: None })
} |
If this is feeling like more trouble than it's worth, we could do an end-run around this issue by moving more directly to a world where connectors listen on a port over which they serve gRPC, and which the runtime dials. |
@jgraettinger yeah I think that's a better approach |
Relevant PR: #674 (comment) |
Closing this issue since we have gone ahead and switched to TCP communications, so this is no longer applicable. #682 |
Currently connector-proxy operates in this way:
The issue is, the runtime waits for the stdout of connector-proxy to be closed before it closes its stdin. With our current implementation, connector-proxy likewise wants to wait until it has read all from runtime before it exits.
At the moment there is a workaround where if the underlying connector exits, we wait a few seconds and then exit connector-proxy to avoid a deadlock. However, the ideal situation is where we have stdin and stdout as independent parts.
The text was updated successfully, but these errors were encountered: