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

reading from standard input is broken #12

Closed
GoogleCodeExporter opened this issue Aug 18, 2015 · 3 comments
Closed

reading from standard input is broken #12

GoogleCodeExporter opened this issue Aug 18, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

It turns out that reading from standard input (as currently implemented) 
only works under certain lucky situations.  It uses non-blocking mode, so 
the input will be truncated if reading blocks for any reason.  It's a 
silent loss of data, so it's kind of a scary bug.  Here's how to reproduce 
it:

cat some_big_file |bin/pssh -i -H localhost "cat >test_file"

In theory, this should make test_file identical to some_big_file.  However, 
since pssh has to read from a pipe from cat, it will usually block at some 
point (particularly if the file is big).

I'm concerned about how to fix this without breaking backwards 
compatibility.  Unfortunately, the current syntax tries to automatically 
detect whether input is available, but this isn't easy to do (if there's a 
delay in reading the input, is it really safe to assume that it won't be 
arriving shortly?).  There are some ways to reduce the severity of the bug, 
but I think that there isn't any way to really fix it without requiring the 
user to specify that they are passing input.

I'm inclined to add a new explicit command-line option (perhaps "-I") to 
indicate that pssh should read from standard input.  If we went this route, 
we could deprecate the current approach; for a few versions, we could 
continue to honor input but give an error message warning that the behavior 
is deprecated.  Any thoughts?

Original issue reported on code.google.com by amcna...@gmail.com on 19 Feb 2010 at 3:14

@GoogleCodeExporter
Copy link
Author

Original comment by amcna...@gmail.com on 19 Feb 2010 at 3:14

  • Added labels: Priority-High
  • Removed labels: Priority-Medium

@GoogleCodeExporter
Copy link
Author

I have implemented the behavior described above.  The "-I" option makes pssh 
read from 
standard input.  If pssh reads from standard input without the "-I" option 
being 
given, it prints a deprecation warning.

Original comment by amcna...@gmail.com on 22 Feb 2010 at 11:25

  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

I haven't heard any complaints over the last week, so for now I'll assume that 
everyone is happy.  Please reopen the bug report if you have any problems.

Original comment by amcna...@gmail.com on 24 Feb 2010 at 7:11

  • Changed state: Fixed

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

No branches or pull requests

1 participant