Merge branch 'stable-2.16' into stable-3.0
* stable-2.16:
Improve logging when catching a zookeeper error
Change-Id: I02fc28368b7a5a518a97c176825be1706f63387f
diff --git a/src/main/java/com/googlesource/gerrit/plugins/multisite/validation/RefUpdateValidator.java b/src/main/java/com/googlesource/gerrit/plugins/multisite/validation/RefUpdateValidator.java
index b23b65a..76c1a67 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/multisite/validation/RefUpdateValidator.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/multisite/validation/RefUpdateValidator.java
@@ -161,6 +161,11 @@
sharedRefDb.compareAndPut(
new Project.NameKey(projectName), refPair.compareRef, refPair.putValue);
} catch (GlobalRefDbSystemError e) {
+ logger.atWarning().withCause(e).log(
+ "Not able to persist the data in Zookeeper for project '{}' and ref '{}', message: {}",
+ projectName,
+ refPair.getName(),
+ e.getMessage());
throw new SharedDbSplitBrainException(errorMessage, e);
}
@@ -265,9 +270,7 @@
@Override
public void close() {
- elements
- .values()
- .stream()
+ elements.values().stream()
.forEach(
closeable -> {
try {