Skip to content

storage::ObjectWriteStream left in unusable state after Suspend() or moves #7044

@coryan

Description

@coryan

What component of google-cloud-cpp is this related to?

Storage.

Describe the bug

When using an storage::ObjectWriteStream some operations can result in a crash, for example:

void F(gcs::Client c) {
  auto stream = c.WriteObject(...);

  std::move(stream).Suspend();
  stream.last_status(); // <-- crash
}

void G(gcs::Client c) {
  auto stream = c.WriteObject(...);

  auto os = std::move(stream); 
  stream.last_status(); // <-- crash
}

Expected behavior

The class should not crash, maybe return the last before the move-from, or maybe return Status(StatusCode::kInvalid, ...).

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the Cloud Storage API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions