-
Notifications
You must be signed in to change notification settings - Fork 175
Description
See #6665 (comment):
Do we also want a Flush call that waits until all data written has been read? Currently I think it's possible for
vic-machineto exit without having pushed all of the log data to the datastore, depending on timing.
I would not be surprised to see truncation of the last informational portions of the output.
And #6665 (comment):
The way this is written there's nothing preventing multiple concurrent calls to
Readwhich would leave all but one thread blocked indefinitely.I think both
WriteandCloseshould be using cond.Broadcast(). If we're being good then Read() should also have a deferred Broadcast so that one Read completing will allow another to continue - this model also allows for addition of a Flush semantic.
And #6665 (comment):
There is a race here - we could have called
bp.Close()before thebp.Readtakes place. I'm not sure it can be resolved and still have the test pass reliably without changing Close to a flushing semantic, i.e. Closed to writing, but allows read to continue to drain existing data.