open-nomad/client/lib/fifo
Mahmood Ali 967452a3f0 fifo: Use plain fifo file in Unix
This PR switches to using plain fifo files instead of golang structs
managed by containerd/fifo library.

The library main benefit is management of opening fifo files.  In Linux,
a reader `open()` request would block until a writer opens the file (and
vice-versa).  The library uses goroutines so that it's the first IO
operation that blocks.

This benefit isn't really useful for us: Given that logmon simply
streams output in a separate process, blocking of opening or first read
is effectively the same.

The library additionally makes further complications for managing state
and tracking read/write permission that seems overhead for our use,
compared to using a file directly.

Looking here, I made the following incidental changes:
* document that we do handle if fifo files are already created, as we
rely on that behavior for logmon restarts
* use type system to lock read vs write: currently, fifo library returns
`io.ReadWriteCloser` even if fifo is opened for writing only!
2019-04-01 13:18:03 -04:00
..
doc.go fifo: add new fifo package for named pipes (#4665) 2018-10-16 16:53:30 -07:00
fifo_test.go fifo: Use plain fifo file in Unix 2019-04-01 13:18:03 -04:00
fifo_unix.go fifo: Use plain fifo file in Unix 2019-04-01 13:18:03 -04:00
fifo_windows.go fifo: Use plain fifo file in Unix 2019-04-01 13:18:03 -04:00