Skip to content

A status don't check and are written by later code in BlobGCJob::InstallOutputBlobFiles #238

@apple-ouyang

Description

@apple-ouyang

In BlobGCJob::InstallOutputBlobFiles, which is blob_gc_joob.cc:415, the status are not checked.

for (auto& builder : blob_file_builders_) {
    BlobFileBuilder::OutContexts contexts;
    s = builder.second->Finish(&contexts);  // Status not check
    BatchWriteNewIndices(contexts, &s);     // Status is written
    if (!s.ok()) {
      break;
    }
    metrics_.gc_num_new_files++;

At the same time, I think the BatchWriteNewIndices(contexts, &s) can be rewritten like s = BatchWriteNewIndices(contexts)
This will ensure code consistency as every funciton return a stauts.

I can make a PR to fix thoese 2 things If you like.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions