This is an automated email from the ASF dual-hosted git repository.

daim pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git


The following commit(s) were added to refs/heads/trunk by this push:
     new c829f4d5f5 OAK-11985 : added MongoServerUnavailableException into 
transient errors (#2582)
c829f4d5f5 is described below

commit c829f4d5f57f035d14372dc9ca40583307a35369
Author: Rishabh Kumar <[email protected]>
AuthorDate: Tue Oct 14 21:49:54 2025 +0530

    OAK-11985 : added MongoServerUnavailableException into transient errors 
(#2582)
---
 .../org/apache/jackrabbit/oak/plugins/document/mongo/MongoUtils.java  | 4 +++-
 .../apache/jackrabbit/oak/plugins/document/mongo/MongoUtilsTest.java  | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoUtils.java
 
b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoUtils.java
index b5a1f14397..441b784b70 100644
--- 
a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoUtils.java
+++ 
b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoUtils.java
@@ -23,6 +23,7 @@ import com.mongodb.BasicDBObject;
 import com.mongodb.MongoCommandException;
 import com.mongodb.MongoException;
 import com.mongodb.MongoNotPrimaryException;
+import com.mongodb.MongoServerUnavailableException;
 import com.mongodb.MongoSocketException;
 import com.mongodb.MongoWriteConcernException;
 import com.mongodb.ReadPreference;
@@ -180,7 +181,8 @@ class MongoUtils {
         Type type = Type.GENERIC;
         if (t instanceof MongoSocketException
                 || t instanceof MongoWriteConcernException
-                || t instanceof MongoNotPrimaryException) {
+                || t instanceof MongoNotPrimaryException
+                || t instanceof MongoServerUnavailableException) {
             type = Type.TRANSIENT;
         } else if (t instanceof MongoCommandException
                 || t instanceof WriteConcernException
diff --git 
a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoUtilsTest.java
 
b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoUtilsTest.java
index dbd10f2123..e3869f686f 100644
--- 
a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoUtilsTest.java
+++ 
b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoUtilsTest.java
@@ -24,6 +24,7 @@ import com.mongodb.BasicDBObject;
 import com.mongodb.DuplicateKeyException;
 import com.mongodb.MongoCommandException;
 import com.mongodb.MongoException;
+import com.mongodb.MongoServerUnavailableException;
 import com.mongodb.MongoSocketException;
 import com.mongodb.ServerAddress;
 import com.mongodb.WriteConcernException;
@@ -158,6 +159,7 @@ public class MongoUtilsTest {
         assertEquals(TRANSIENT, 
getDocumentStoreExceptionTypeFor(newMongoCommandException(11601)));
         assertEquals(TRANSIENT, 
getDocumentStoreExceptionTypeFor(newMongoCommandException(11602)));
         assertEquals(TRANSIENT, getDocumentStoreExceptionTypeFor(new 
MongoSocketException("message", new ServerAddress())));
+        assertEquals(TRANSIENT, getDocumentStoreExceptionTypeFor(new 
MongoServerUnavailableException("message")));
     }
 
     @Test

Reply via email to