Fail pipe writes when readers leave
Instead of only lazily propagating the "all readers left" error via
streamcache.pipe.Close()
, also eagerly propagate it via
pipe.Write()
.
From a purely functional standpoint, it is simpler and sufficient to only propagate the error via pipe.Close()
. But from an operational standpoint, it is desirable to stop writing bytes to disk as soon as we know the Close()
is going to fail.
Addresses gitlab-com/gl-infra/scalability#999 (closed).
Edited by Jacob Vosmaer