Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
apple-ouyang opened this issue Apr 23, 2022 · 2 comments

Comments

@apple-ouyang
Copy link
Contributor

apple-ouyang commented Apr 23, 2022

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.

@Connor1996
Copy link
Member

Yes, better rewrite it.

@apple-ouyang
Copy link
Contributor Author

I push a PR here #243

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants