You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by "Joscorbe (via GitHub)" <gi...@apache.org> on 2025/08/05 02:47:14 UTC
[PR] OAK-11835: Expose all Mongo connection pool parameters [jackrabbit-oak]
Joscorbe opened a new pull request, #2426:
URL: https://github.com/apache/jackrabbit-oak/pull/2426
(no comment)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11835: Expose all Mongo connection pool parameters [jackrabbit-oak]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #2426:
URL: https://github.com/apache/jackrabbit-oak/pull/2426#issuecomment-3153086380
# Commit-Check ✔️
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11835: Expose all Mongo connection pool parameters [jackrabbit-oak]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #2426:
URL: https://github.com/apache/jackrabbit-oak/pull/2426#issuecomment-3154872220
## [](https://sonarcloud.io/dashboard?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2426) **Quality Gate passed**
Issues
 [3 New issues](https://sonarcloud.io/project/issues?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2426&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2426&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2426&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [98.8% Coverage on New Code](https://sonarcloud.io/component_measures?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2426&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2426&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2426)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11835: Expose all Mongo connection pool parameters [jackrabbit-oak]
Posted by "Joscorbe (via GitHub)" <gi...@apache.org>.
Joscorbe commented on code in PR #2426:
URL: https://github.com/apache/jackrabbit-oak/pull/2426#discussion_r2253524075
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentNodeStoreBuilderBase.java:
##########
@@ -44,12 +48,25 @@ public abstract class MongoDocumentNodeStoreBuilderBase<T extends MongoDocumentN
private MongoStatus mongoStatus;
private long maxReplicationLagMillis = TimeUnit.HOURS.toMillis(6);
private boolean clientSessionDisabled = false;
- private int leaseSocketTimeout = 0;
+ private Integer leaseSocketTimeout;
private String uri;
private String name;
private String collectionCompressionType;
private MongoClient mongoClient;
+ // MongoDB connection pool settings
+ private Integer maxPoolSize;
Review Comment:
They are Integers because in case they are not set (null), they won't be applied and the driver will take the defaults.
Can change them if this is a strong opinion, but my plan was to leave it to the driver's default if we don't set anything (which only happens in no-OSGi runtime).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11835: Expose all Mongo connection pool parameters [jackrabbit-oak]
Posted by "Joscorbe (via GitHub)" <gi...@apache.org>.
Joscorbe merged PR #2426:
URL: https://github.com/apache/jackrabbit-oak/pull/2426
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11835: Expose all Mongo connection pool parameters [jackrabbit-oak]
Posted by "rishabhdaim (via GitHub)" <gi...@apache.org>.
rishabhdaim commented on PR #2426:
URL: https://github.com/apache/jackrabbit-oak/pull/2426#issuecomment-3154120349
@Joscorbe some cases are failing in Document Store.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11835: Expose all Mongo connection pool parameters [jackrabbit-oak]
Posted by "rishabhdaim (via GitHub)" <gi...@apache.org>.
rishabhdaim commented on code in PR #2426:
URL: https://github.com/apache/jackrabbit-oak/pull/2426#discussion_r2253486585
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/Configuration.java:
##########
@@ -87,6 +87,74 @@
"overridden via framework property 'oak.mongo.leaseSocketTimeout'")
int mongoLeaseSocketTimeout() default DocumentNodeStoreService.DEFAULT_MONGO_LEASE_SO_TIMEOUT_MILLIS;
+ @AttributeDefinition(
+ name = "MongoDB Max Pool Size",
+ description = "The maximum number of connections in the MongoDB connection pool. " +
+ "Note that this value can be overridden via framework property 'oak.mongo.maxPoolSize'")
+ int mongoMaxPoolSize() default DocumentNodeStoreService.DEFAULT_MONGO_MAX_POOL_SIZE;
+
+ @AttributeDefinition(
+ name = "MongoDB Min Pool Size",
+ description = "The minimum number of connections in the MongoDB connection pool. " +
+ "Note that this value can be overridden via framework property 'oak.mongo.minPoolSize'")
+ int mongoMinPoolSize() default DocumentNodeStoreService.DEFAULT_MONGO_MIN_POOL_SIZE;
+
+ @AttributeDefinition(
+ name = "MongoDB Max Connecting",
+ description = "Maximum number of connections the MongoDB pool may be establishing concurrently. " +
+ "Note that this value can be overridden via framework property 'oak.mongo.maxConnecting'")
+ int mongoMaxConnecting() default DocumentNodeStoreService.DEFAULT_MONGO_MAX_CONNECTING;
+
+ @AttributeDefinition(
+ name = "MongoDB Max Idle Time (ms)",
+ description = "The maximum idle time in milliseconds of a MongoDB pooled connection. " +
+ "A value of 0 means no limit. " +
+ "Note that this value can be overridden via framework property 'oak.mongo.maxIdleTimeMS'")
+ int mongoMaxIdleTimeMS() default DocumentNodeStoreService.DEFAULT_MONGO_MAX_IDLE_TIME_MS;
+
+ @AttributeDefinition(
+ name = "MongoDB Max Life Time (ms)",
+ description = "The maximum lifetime in milliseconds of a MongoDB pooled connection. " +
+ "A value of 0 means no limit. " +
+ "Note that this value can be overridden via framework property 'oak.mongo.maxLifeTimeMS'")
+ int mongoMaxLifeTimeMS() default DocumentNodeStoreService.DEFAULT_MONGO_MAX_LIFE_TIME_MS;
+
+ @AttributeDefinition(
+ name = "MongoDB Connect Timeout (ms)",
+ description = "The connection timeout in milliseconds for establishing connections to MongoDB. " +
+ "Note that this value can be overridden via framework property 'oak.mongo.connectTimeoutMS'")
+ int mongoConnectTimeoutMS() default DocumentNodeStoreService.DEFAULT_MONGO_CONNECT_TIMEOUT_MS;
+
+ @AttributeDefinition(
+ name = "MongoDB Heartbeat Frequency (ms)",
+ description = "The frequency in milliseconds of the driver checking the state of MongoDB servers. " +
+ "Note that this value can be overridden via framework property 'oak.mongo.heartbeatFrequencyMS'")
+ int mongoHeartbeatFrequencyMS() default DocumentNodeStoreService.DEFAULT_MONGO_HEARTBEAT_FREQUENCY_MS;
+
+ @AttributeDefinition(
+ name = "MongoDB Server Selection Timeout (ms)",
+ description = "How long the driver will wait for server selection to succeed before throwing an exception, in milliseconds. " +
+ "Note that this value can be overridden via framework property 'oak.mongo.serverSelectionTimeoutMS'")
+ int mongoServerSelectionTimeoutMS() default DocumentNodeStoreService.DEFAULT_MONGO_SERVER_SELECTION_TIMEOUT_MS;
Review Comment:
```suggestion
int mongoServerSelectionTimeoutMillis() default DocumentNodeStoreService.DEFAULT_MONGO_SERVER_SELECTION_TIMEOUT_MS;
```
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentNodeStoreBuilderBase.java:
##########
@@ -44,12 +48,25 @@ public abstract class MongoDocumentNodeStoreBuilderBase<T extends MongoDocumentN
private MongoStatus mongoStatus;
private long maxReplicationLagMillis = TimeUnit.HOURS.toMillis(6);
private boolean clientSessionDisabled = false;
- private int leaseSocketTimeout = 0;
+ private Integer leaseSocketTimeout;
private String uri;
private String name;
private String collectionCompressionType;
private MongoClient mongoClient;
+ // MongoDB connection pool settings
+ private Integer maxPoolSize;
Review Comment:
please use `int`
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java:
##########
@@ -144,7 +142,19 @@ public class DocumentNodeStoreService {
static final boolean DEFAULT_EMBEDDED_VERIFICATION_ENABLED = true;
static final int DEFAULT_FULL_GC_MODE = 0;
static final int DEFAULT_FULL_GC_GENERATION = 0;
- static final int DEFAULT_MONGO_LEASE_SO_TIMEOUT_MILLIS = 30000;
+ public static final int DEFAULT_MONGO_LEASE_SO_TIMEOUT_MILLIS = 30000;
+ // MongoDB Connection Pool Settings
+ public static final int DEFAULT_MONGO_MAX_POOL_SIZE = 100;
+ public static final int DEFAULT_MONGO_MIN_POOL_SIZE = 0;
+ public static final int DEFAULT_MONGO_MAX_CONNECTING = 2;
+ public static final int DEFAULT_MONGO_MAX_IDLE_TIME_MS = 0;
Review Comment:
```suggestion
public static final int DEFAULT_MONGO_MAX_IDLE_TIME_MILLIS = 0;
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11835: Expose all Mongo connection pool parameters [jackrabbit-oak]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #2426:
URL: https://github.com/apache/jackrabbit-oak/pull/2426#issuecomment-3154215201
## [](https://sonarcloud.io/dashboard?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2426) **Quality Gate passed**
Issues
 [3 New issues](https://sonarcloud.io/project/issues?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2426&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2426&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2426&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [98.8% Coverage on New Code](https://sonarcloud.io/component_measures?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2426&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2426&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=2426)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11835: Expose all Mongo connection pool parameters [jackrabbit-oak]
Posted by "Joscorbe (via GitHub)" <gi...@apache.org>.
Joscorbe commented on code in PR #2426:
URL: https://github.com/apache/jackrabbit-oak/pull/2426#discussion_r2253529946
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/Configuration.java:
##########
@@ -87,6 +87,74 @@
"overridden via framework property 'oak.mongo.leaseSocketTimeout'")
int mongoLeaseSocketTimeout() default DocumentNodeStoreService.DEFAULT_MONGO_LEASE_SO_TIMEOUT_MILLIS;
+ @AttributeDefinition(
+ name = "MongoDB Max Pool Size",
+ description = "The maximum number of connections in the MongoDB connection pool. " +
+ "Note that this value can be overridden via framework property 'oak.mongo.maxPoolSize'")
+ int mongoMaxPoolSize() default DocumentNodeStoreService.DEFAULT_MONGO_MAX_POOL_SIZE;
+
+ @AttributeDefinition(
+ name = "MongoDB Min Pool Size",
+ description = "The minimum number of connections in the MongoDB connection pool. " +
+ "Note that this value can be overridden via framework property 'oak.mongo.minPoolSize'")
+ int mongoMinPoolSize() default DocumentNodeStoreService.DEFAULT_MONGO_MIN_POOL_SIZE;
+
+ @AttributeDefinition(
+ name = "MongoDB Max Connecting",
+ description = "Maximum number of connections the MongoDB pool may be establishing concurrently. " +
+ "Note that this value can be overridden via framework property 'oak.mongo.maxConnecting'")
+ int mongoMaxConnecting() default DocumentNodeStoreService.DEFAULT_MONGO_MAX_CONNECTING;
+
+ @AttributeDefinition(
+ name = "MongoDB Max Idle Time (ms)",
+ description = "The maximum idle time in milliseconds of a MongoDB pooled connection. " +
+ "A value of 0 means no limit. " +
+ "Note that this value can be overridden via framework property 'oak.mongo.maxIdleTimeMS'")
+ int mongoMaxIdleTimeMS() default DocumentNodeStoreService.DEFAULT_MONGO_MAX_IDLE_TIME_MS;
+
+ @AttributeDefinition(
+ name = "MongoDB Max Life Time (ms)",
+ description = "The maximum lifetime in milliseconds of a MongoDB pooled connection. " +
+ "A value of 0 means no limit. " +
+ "Note that this value can be overridden via framework property 'oak.mongo.maxLifeTimeMS'")
+ int mongoMaxLifeTimeMS() default DocumentNodeStoreService.DEFAULT_MONGO_MAX_LIFE_TIME_MS;
+
+ @AttributeDefinition(
+ name = "MongoDB Connect Timeout (ms)",
+ description = "The connection timeout in milliseconds for establishing connections to MongoDB. " +
+ "Note that this value can be overridden via framework property 'oak.mongo.connectTimeoutMS'")
+ int mongoConnectTimeoutMS() default DocumentNodeStoreService.DEFAULT_MONGO_CONNECT_TIMEOUT_MS;
+
+ @AttributeDefinition(
+ name = "MongoDB Heartbeat Frequency (ms)",
+ description = "The frequency in milliseconds of the driver checking the state of MongoDB servers. " +
+ "Note that this value can be overridden via framework property 'oak.mongo.heartbeatFrequencyMS'")
+ int mongoHeartbeatFrequencyMS() default DocumentNodeStoreService.DEFAULT_MONGO_HEARTBEAT_FREQUENCY_MS;
+
+ @AttributeDefinition(
+ name = "MongoDB Server Selection Timeout (ms)",
+ description = "How long the driver will wait for server selection to succeed before throwing an exception, in milliseconds. " +
+ "Note that this value can be overridden via framework property 'oak.mongo.serverSelectionTimeoutMS'")
+ int mongoServerSelectionTimeoutMS() default DocumentNodeStoreService.DEFAULT_MONGO_SERVER_SELECTION_TIMEOUT_MS;
Review Comment:
Changed, thanks!
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java:
##########
@@ -144,7 +142,19 @@ public class DocumentNodeStoreService {
static final boolean DEFAULT_EMBEDDED_VERIFICATION_ENABLED = true;
static final int DEFAULT_FULL_GC_MODE = 0;
static final int DEFAULT_FULL_GC_GENERATION = 0;
- static final int DEFAULT_MONGO_LEASE_SO_TIMEOUT_MILLIS = 30000;
+ public static final int DEFAULT_MONGO_LEASE_SO_TIMEOUT_MILLIS = 30000;
+ // MongoDB Connection Pool Settings
+ public static final int DEFAULT_MONGO_MAX_POOL_SIZE = 100;
+ public static final int DEFAULT_MONGO_MIN_POOL_SIZE = 0;
+ public static final int DEFAULT_MONGO_MAX_CONNECTING = 2;
+ public static final int DEFAULT_MONGO_MAX_IDLE_TIME_MS = 0;
Review Comment:
Applied to all similar cases, thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org