[pkg] Do not open blobs to check for presence

During resolves, after the meta.far is fetched, when checking to see
if a content blob or subpackage meta.far needs to be downloaded,
pkg-cache tries to open the blob. This is not correct, because on
c++blob READ connections to partially written blobs keep the blob
alive even after the writer closes its connection, which creates the
following race condition:

1. blob is partially written by a concurrent resolve
2. blob is opened to check for presence
3. concurrent resolve hits an error and retries the fetch, which
   attempts to open the blob for write, which fails

Local Storage has said that ReadDirents on /blob for both c++blob and
fxblob is guaranteed to return blobs if and only if they are fully
written and do not have outstanding deletion requests, this CL removes
the open double check and relies only on ReadDirents to determine
which blobs are missing.

Fixed: 337104426
Change-Id: I20365520f8d4b01e26cce9a900db7ec9a2b93914
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1037588
Reviewed-by: Sen Jiang <senj@google.com>
Commit-Queue: Ben Keller <galbanum@google.com>
7 files changed
tree: 0b35cf34ffa4509445fc82d8b26d97a5fbfc13fb
  1. boards/
  2. build/
  3. bundles/
  4. docs/
  5. examples/
  6. infra/
  7. products/
  8. scripts/
  9. sdk/
  10. src/
  11. third_party/
  12. tools/
  13. zircon/
  14. .clang-format
  15. .clang-tidy
  16. .editorconfig
  17. .git-blame-ignore-revs
  18. .gitattributes
  19. .gitignore
  20. .gitmodules
  21. .gn
  22. .ignore
  23. analysis_options.yaml
  24. AUTHORS
  25. BUILD.gn
  26. CODE_OF_CONDUCT.md
  27. CONTRIBUTING.md
  28. fuchsia.code-workspace
  29. LICENSE
  30. OWNERS
  31. PATENTS
  32. pyproject.toml
  33. pyrightconfig.json
  34. README.md
  35. rustfmt.toml
  36. shac.star
  37. shac.textproto
README.md

Fuchsia

What is Fuchsia?

Fuchsia is an open source, general purpose operating system supporting modern 64-bit Intel and ARM processors.

We expect everyone interacting with our project to respect our code of conduct.

Read more about Fuchsia's principles.

How can I build and run Fuchsia?

See Getting Started.

Where can I learn more about Fuchsia?

See fuchsia.dev.