S3BinaryCacheStore::isValidPath(): Do a GET instead of HEAD
[?]
Feb 19, 2016, 4:41 PM
QSBS2ISOQ2ZFYZIAZPWD26UYFSWIFWR47R5WUEJKIQJKKJWXOZDACDependencies
- [2]
XLYHZUHTCache .narinfo lookups - [3]
SOB276BAKeep some statistics for the binary cache stores - [4]
GTUZLZRHAdd an S3-backed binary cache store - [5]
EOO4EFWDUse a single BinaryCacheStore for all threads - [6]
N2NKSKHSRefactor local binary cache code into a subclass - [7]
32HHP5CWhydra-queue-runner: Support generating a signed binary cache - [8]
W2AOTSS6Rename class - [9]
73YR46NJhydra-queue-runner: Write directly to a binary cache
Change contents
- edit in src/hydra-queue-runner/binary-cache-store.cc at line 105
stats.narInfoRead++; - edit in src/hydra-queue-runner/binary-cache-store.cc at line 109
stats.narInfoRead++; - edit in src/hydra-queue-runner/binary-cache-store.hh at line 76
protected: - edit in src/hydra-queue-runner/s3-binary-cache-store.cc at line 2
#include "nar-info.hh" - edit in src/hydra-queue-runner/s3-binary-cache-store.cc at line 14
struct S3Error : public Error{Aws::S3::S3Errors err;S3Error(Aws::S3::S3Errors err, const FormatOrString & fs): Error(fs), err(err) { };}; - replacement in src/hydra-queue-runner/s3-binary-cache-store.cc at line 28
throw Error(format("AWS error: %1%") % outcome.GetError().GetMessage());throw S3Error(outcome.GetError().GetErrorType(),format("AWS error: %1%") % outcome.GetError().GetMessage()); - edit in src/hydra-queue-runner/s3-binary-cache-store.cc at line 79
}/* This is a specialisation of isValidPath() that optimisticallyfetches the .narinfo file, rather than first checking for itsexistence via a HEAD request. Since .narinfos are small, doing aGET is unlikely to be slower than HEAD. */bool S3BinaryCacheStore::isValidPath(const Path & storePath){try {readNarInfo(storePath);return true;} catch (S3Error & e) {if (e.err == Aws::S3::S3Errors::NO_SUCH_KEY) return false;throw;} - edit in src/hydra-queue-runner/s3-binary-cache-store.hh at line 41
bool isValidPath(const Path & storePath) override;