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

Kevin Frei via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 7 14:45:57 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, "");
----------------
kevinfrei wrote:

I'm working on exposing some of the internal, fixed settings of Debuginfod as debugger settings currently. I disagree with your assessment of what "momentary" is, as the current setting waits for a full 45 seconds before it stops, so having an unreachable server is catastrophically bad (in my direct experience: My development machine lives in a data center where the distro has DEBUGINFOD_URLS configured to an unreachable server). 

Even if we do set the timeout's much lower, the user experience is pretty horrific without some sort of negative caching, as each binary/.so triggers the timeout. So even setting it down to just a few seconds results in a downed server triggering a whole lot of user wait time.

Overall, this is, perhaps not the 'right' workaround. I'm working to shift Debuginfod access, generally, to an async model by default (or just off?) because the impact to user experience is just so very bad when it's misconfigured...

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


More information about the llvm-commits mailing list