Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EVA-3713 Adding Hikari max pool size connection property configuration #60

Merged
merged 2 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ebi_eva_internal_pyutils/spring_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def _count_stats_properties(self):
'eva.count-stats.password': counts_password
}

def _common_properties(self, *, read_preference='primary', chunk_size=100):
def _common_properties(self, *, read_preference='primary', chunk_size=100, max_pool_size=2):
"""Properties common to all Spring pipelines"""
props = {
'spring.datasource.driver-class-name': 'org.postgresql.Driver',
Expand All @@ -98,6 +98,7 @@ def _common_properties(self, *, read_preference='primary', chunk_size=100):
'spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults': 'false',
'spring.jpa.database-platform': 'org.hibernate.dialect.PostgreSQL9Dialect',
'parameters.chunkSize': chunk_size,
'spring.datasource.hikari.maximum-pool-size': max_pool_size
}
merge = {**self._mongo_properties(), **self._count_stats_properties(), **props}
return merge
Expand Down
9 changes: 9 additions & 0 deletions tests/internal/test_spring_prop.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def test_get_remapping_extraction_properties(self):
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQL9Dialect
spring.datasource.hikari.maximum-pool-size=2
spring.datasource.url=jdbc:postgresql://host1.example.com:5432/accjtdb
spring.datasource.username=accuser
spring.datasource.password=accpassword
Expand Down Expand Up @@ -65,6 +66,7 @@ def test_get_remapping_ingestion_properties(self):
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQL9Dialect
spring.datasource.hikari.maximum-pool-size=2
spring.datasource.url=jdbc:postgresql://host1.example.com:5432/accjtdb
spring.datasource.username=accuser
spring.datasource.password=accpassword
Expand Down Expand Up @@ -103,6 +105,7 @@ def test_get_clustering_properties(self):
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQL9Dialect
spring.datasource.hikari.maximum-pool-size=2
spring.datasource.url=jdbc:postgresql://host1.example.com:5432/accjtdb
spring.datasource.username=accuser
spring.datasource.password=accpassword
Expand Down Expand Up @@ -152,6 +155,7 @@ def test_get_accessioning_properties(self):
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQL9Dialect
spring.datasource.hikari.maximum-pool-size=2
spring.datasource.url=jdbc:postgresql://host1.example.com:5432/accjtdb
spring.datasource.username=accuser
spring.datasource.password=accpassword
Expand Down Expand Up @@ -206,6 +210,7 @@ def test_get_variant_load_properties(self):
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQL9Dialect
spring.datasource.hikari.maximum-pool-size=2
spring.profiles.active=production,mongo
spring.profiles.include=variant-writer-mongo,variant-annotation-mongo
spring.data.mongodb.authentication-mechanism=SCRAM-SHA-1
Expand Down Expand Up @@ -272,6 +277,7 @@ def test_get_variant_load_properties_no_mongo_cred(self):
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQL9Dialect
spring.datasource.hikari.maximum-pool-size=2
spring.profiles.active=production,mongo
spring.profiles.include=variant-writer-mongo,variant-annotation-mongo
spring.data.mongodb.authentication-mechanism=SCRAM-SHA-1
Expand Down Expand Up @@ -337,6 +343,7 @@ def test_get_accession_import_properties(self):
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQL9Dialect
spring.datasource.hikari.maximum-pool-size=2
spring.profiles.active=production,mongo
spring.profiles.include=variant-writer-mongo,variant-annotation-mongo
spring.data.mongodb.authentication-mechanism=SCRAM-SHA-1
Expand Down Expand Up @@ -385,6 +392,7 @@ def test_get_accessioning_properties_with_none(self):
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQL9Dialect
spring.datasource.hikari.maximum-pool-size=2
spring.datasource.url=jdbc:postgresql://host1.example.com:5432/accjtdb
spring.datasource.username=accuser
spring.datasource.password=accpassword
Expand Down Expand Up @@ -437,6 +445,7 @@ def test_get_release_properties(self):
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQL9Dialect
spring.datasource.hikari.maximum-pool-size=2
spring.datasource.url=jdbc:postgresql://host1.example.com:5432/accjtdb
spring.datasource.username=accuser
spring.datasource.password=accpassword
Expand Down
Loading