Skip to content

Ensure VCH creation log streaming flushes all data before exiting #6732

@zjs

Description

@zjs

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-machine to 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 Read which would leave all but one thread blocked indefinitely.

I think both Write and Close should 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 the bp.Read takes 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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions