-
Notifications
You must be signed in to change notification settings - Fork 25
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
Avoid nout=0 on last pipe component #90
Comments
Both Again, can you please run the first with DGSH_DEBUG_LEVEL=4 and share the log output? |
https://gist.github.com/lucaswerkmeister/50cfb49a5be6ddfa1172172048001147 ( |
Hm, this is a bug. The bug happens because the After the negotiation is over, Pending a permanent a work around one can prepend a tee/cat command: |
Suggestion: concentrators whose input or output is a tty should |
Better: if the input-side concentrator sees that only a single process on its output side requires input, then it will send its input file descriptor to that process before exiting. |
There is a problem. Currently we can't know for sure which processes can take input or not. For instance, take this imaginary command graph The
Currently there is no distinction between the two cases and, therefore, we can't, I think, provide a solution to this issue without clarifying the input channel availability semantics. |
This example is somewhat constructed, but:
If you run that command and type something into standard input, nothing will appear on standard output. I think this is because
dgsh
negotiates zero output file descriptors (cat
declaresn_output_fds=-1
), which isn’t very useful for the last component of a pipe.I’ve also noticed this for my own ja2l program: if you run something like
cat /proc/mounts | ./build/libexec/dgsh/ja2l
, my program prints:(I added explicit error detection for this case, because otherwise my program crashes – it needs 1—N output fds, there’s just no mechanism to communicate this.)
The problem with this bug report is that this pipeline does print something:
and so does this one:
even though
DGSH_DEBUG_LEVEL=3
output in this case also indicates nout=0 for one component (which I would assume to be the finalcat
). So I might be misunderstanding something here…TL;DR: if the last pipe component declares nout=-1, perhaps negotiate nout=1 (stdout) instead of nout=0?
The text was updated successfully, but these errors were encountered: