TBR: playground: Change gosh.Cmd.StdinPipe to have unlimited-size.

It's more convenient for users if StdinPipe has an unlimited
size; otherwise they need to worry about deadlock.  You might
think we could just use our buffered pipe and be done with it,
but it's pretty tricky.  In particular os/exec will create its
own os.Pipe and a copier goroutine if we don't pass in a *os.File
for exec.Cmd.Stdin, and exec.Cmd.Wait will wait for that
goroutine to finish.

Note that we can't call exec.Cmd.StdinPipe; that ensures that
Close is only called once, but doesn't ensure Write and Close
calls are synchronous.  This makes a race possible: the user may
call Write on the StdinPipe, concurrently with the exit-waiter
goroutine calling Close on the StdinPipe when the process exits.
This race has shown up on jenkins, and is also easily
reproduced (under heavy machine load) with the new test.

To make this all work, we create our own os.Pipe that we set for
exec.Cmd.Stdin, and also create a buffered pipe, along with our
own copier goroutine.

MultiPart: 3/3

Change-Id: Idfbaee7611ef51b8bf786eb2cfbb074c6a0b53f3
1 file changed
tree: 34765f273d605aa1d2b1dcba5dce64073ae5694c
  1. client/
  2. go/
  3. .gitignore
  4. AUTHORS
  5. CONTRIBUTING.md
  6. CONTRIBUTORS
  7. LICENSE
  8. PATENTS
  9. README.md
  10. VERSION
README.md

This repository contains the Vanadium project playground.