[llvm] Debuginfod failed-server cache (PR #74757)

Daniel Thornburgh via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 7 14:51:51 PST 2023


================
@@ -194,6 +194,26 @@ Error StreamedHTTPResponseHandler::handleBodyChunk(StringRef BodyChunk) {
   return Error::success();
 }
 
+// Create a file cache entry to remember if a given server failed
+Expected<AddStreamFn> CheckServerFailure(FileCache &Cache, uint &Task,
+                                         StringRef ServerUrl) {
+  SmallString<96> CachedServerFailurePath(ServerUrl);
+  llvm::transform(CachedServerFailurePath, CachedServerFailurePath.begin(),
+                  [&](char c) { return std::isalnum(c) ? c : '_'; });
+  CachedServerFailurePath.append(".failed");
+  return Cache(Task, CachedServerFailurePath, "");
----------------
mysterymath wrote:

Sorry, by "momentary", I meant that if a server were actually to momentarily become unavailable, this caching implementation would make that failure last up to one additional week after the server had recovered. That's much worse than debuginfod not working well if misconfigured, since it would make it work much worse if properly configured. A user can fix configurations, but they can't usually make their internet connection more reliable.

https://github.com/llvm/llvm-project/pull/74757


More information about the llvm-commits mailing list