summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntonio Barone <syntonyze@gmail.com>2025-09-24 12:23:40 +0200
committerLuca Milanesio <luca.milanesio@gmail.com>2025-09-24 07:26:56 -0700
commitffc3775d2aa09cc14b9a2819f5117ed236f61c0a (patch)
tree047a69ab8190f2223495840809aaa9b064c84356
parentdd952f9d1b7a76111611d7c3295558ab696b65a5 (diff)
Skip unloadable changes in ChangesByProjectCacheupstream/stable-3.6
getUpdatedChangeDatas() caught exceptions while loading a change, but still returned the entry. Downstream permission/visibility checks during git-upload-pack then encountered the invalid change and triggered an Internal Server Error. This issue was visible on replicas, since they do not rely on the change index for visibility checks but instead load changes directly from NoteDb. As a result, corrupted or unloadable changes caused errors to bubble up to clients. This change skips any change that fails to load by continuing the loop from the catch block. The existing log at finest is preserved, and bad changes no longer leak into the result list. Effects: - Avoids failures during git-upload-pack when visibility is evaluated. - Ensures the cache returns only valid ChangeData. - Maintains resilience: one bad change does not block others. Bug: Issue 446941362 Release-Notes: Fixed git-upload-pack errors on replicas by skipping unloadable changes Change-Id: If20740fd861f2321f0b9d893bd6f0376042afa2c (cherry picked from commit 8a6d152f6929c2caa612fcc972de06b552ba063c)
-rw-r--r--java/com/google/gerrit/server/git/ChangesByProjectCacheImpl.java1
1 files changed, 1 insertions, 0 deletions
diff --git a/java/com/google/gerrit/server/git/ChangesByProjectCacheImpl.java b/java/com/google/gerrit/server/git/ChangesByProjectCacheImpl.java
index 1e1c7a3d62..70df3dc8be 100644
--- a/java/com/google/gerrit/server/git/ChangesByProjectCacheImpl.java
+++ b/java/com/google/gerrit/server/git/ChangesByProjectCacheImpl.java
@@ -172,6 +172,7 @@ public class ChangesByProjectCacheImpl implements ChangesByProjectCache {
} catch (Exception ex) {
// Do not let a bad change prevent other changes from being available.
logger.atFinest().withCause(ex).log("Can't load changeData for %s", id);
+ continue;
}
cds.add(cd);
}