cristibalan/braid

`Braid::Operations::Proxy::exec` deadlock when subprocess writes too much to stderr

mattmccutchen opened this issue · 3 comments

The Braid::Operations::Proxy::exec method tries to read the subprocess's stdout to EOF before it reads the stderr, so it deadlocks if the subprocess tries to write more to stderr than the OS's buffer size before closing stdout.

The case I ran into was adding a mirror of an upstream repository that has many refs, so the listing of fetched refs printed by git fetch to stderr gets very long. Specifically, this reproduces the problem for me:

braid add -r ef3ad82a04edc164555c619575ffa0716e6258be -p packages/minimongo https://github.com/meteor/meteor packages/minimongo

An easy change that avoids the problem in this case (and which we may want anyway): add the --quiet option to git fetch.

However, we should probably implement a general-purpose function like Braid::Operations::Proxy::exec correctly. A quick web search found Open3.capture3, which is exactly what we want if it's available in all the Ruby versions that Braid intends to support. @realityforge, what versions are these? We should document the Ruby version assumption, ideally in the gemspec, although I don't know if what we want to say about regular Ruby vs. JRuby can be expressed in the gemspec.

As to which ruby versions we support. I would probably stop supporting any the ruby team has determined to be "obsolete" or unsupported. Looking at wikipedia page https://en.wikipedia.org/wiki/Ruby_(programming_language) it seems that 2.2 is no longer "supported" but will still receive security patches till "2018-03-31". I would be inclined to peg it as our supported release but if you require something from 2.3 maybe that would be acceptable to be our latest supported version.

Which reminds me. I think I need to redeploy all my works rubies ;)

Thoughts?

Ruby MRI 2.2 is more than enough for anything I've wanted to use so far, so it sounds good to me. Are we supporting JRuby? The Travis CI configuration currently includes jruby-19mode. Is there a simple correspondence between JRuby and Ruby MRI versions, or do we need to pick a minimum JRuby version and then check that each feature we want to use is available in both our minimum Ruby MRI version and our minimum JRuby version?

It has been a while since we have used jruby but I would guess that you can probably just rely on modernish version of ruby 9000 line. People using it seem to update reasonably regularly.
Perhaps as far back as 9.1.1.0 or maybe just back to 9.1.3.0

Not sure. Also not sure if we have any commandline users using jruby