From cb9ff7c7b87de22e779af4e64f322b6e4e83e04a Mon Sep 17 00:00:00 2001 From: claudiofr Date: Mon, 13 Feb 2023 15:02:22 -0500 Subject: [PATCH] Changed default beaker cache table name to beaker_cache for all caches All 3 beaker caches, mulled_resolution, citations, biotools service, now use the same default cache table, beaker_cache. This reduces the number of open db connections because beaker creates a separate sqlalchemy engine and associated connection pool for each distinct table and each connection pool opens up a certain number of connections. This was causing the integration tests to fail because the max postgress connections(100) were being exceeded. --- doc/source/admin/galaxy_options.rst | 6 +++--- lib/galaxy/config/schemas/config_schema.yml | 6 +++--- lib/galaxy/managers/citations.py | 2 +- lib/galaxy/tools/biotools.py | 2 +- test/unit/app/managers/test_CitationsManager_db.py | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/source/admin/galaxy_options.rst b/doc/source/admin/galaxy_options.rst index 4e92fa0151a..665c39662b4 100644 --- a/doc/source/admin/galaxy_options.rst +++ b/doc/source/admin/galaxy_options.rst @@ -1289,7 +1289,7 @@ When biotools_service_cache_type = ext:database, this is the database table name used by beaker for bio.tools web service request related caching. -:Default: ``biotools_service_beaker_cache`` +:Default: ``beaker_cache`` :Type: str @@ -1369,7 +1369,7 @@ When citation_cache_type = ext:database, this is the database table name used by beaker for citation related caching. -:Default: ``citation_beaker_cache`` +:Default: ``beaker_cache`` :Type: str @@ -1455,7 +1455,7 @@ When mulled_resolution_cache_type = ext:database, this is the database table name used by beaker for caching mulled resolution requests. -:Default: ``mulled_resolution_beaker_cache`` +:Default: ``beaker_cache`` :Type: str diff --git a/lib/galaxy/config/schemas/config_schema.yml b/lib/galaxy/config/schemas/config_schema.yml index ef153d1ac8a..8a3e0d39761 100644 --- a/lib/galaxy/config/schemas/config_schema.yml +++ b/lib/galaxy/config/schemas/config_schema.yml @@ -914,7 +914,7 @@ mapping: biotools_service_cache_table_name: type: str - default: biotools_service_beaker_cache + default: beaker_cache required: false desc: | Database table used by beaker for bio.tools web service request @@ -964,7 +964,7 @@ mapping: citation_cache_table_name: type: str - default: citation_beaker_cache + default: beaker_cache required: false desc: | Database table used by beaker for citation related caching. @@ -1014,7 +1014,7 @@ mapping: mulled_resolution_cache_table_name: type: str - default: mulled_resolution_beaker_cache + default: beaker_cache required: false desc: | Database table used by beaker for caching mulled resolution requests. diff --git a/lib/galaxy/managers/citations.py b/lib/galaxy/managers/citations.py index 451994fe93b..cf88e566060 100644 --- a/lib/galaxy/managers/citations.py +++ b/lib/galaxy/managers/citations.py @@ -42,7 +42,7 @@ class DoiCache: "cache.data_dir": getattr(config, "citation_cache_data_dir", None), "cache.lock_dir": getattr(config, "citation_cache_lock_dir", None), "cache.url": getattr(config, "citation_cache_url", None), - "cache.table_name": getattr(config, "citation_cache_table_name", "citation_beaker_cache"), + "cache.table_name": getattr(config, "citation_cache_table_name", None), "cache.schema_name": getattr(config, "citation_cache_schema_name", None), } self._cache = CacheManager(**parse_cache_config_options(cache_opts)).get_cache("doi") diff --git a/lib/galaxy/tools/biotools.py b/lib/galaxy/tools/biotools.py index e8ce4d303bb..3f8c1050cc8 100644 --- a/lib/galaxy/tools/biotools.py +++ b/lib/galaxy/tools/biotools.py @@ -20,7 +20,7 @@ def get_galaxy_biotools_metadata_source(config) -> BiotoolsMetadataSource: "cache.data_dir": getattr(config, "biotools_service_cache_data_dir", None), "cache.lock_dir": getattr(config, "biotools_service_cache_lock_dir", None), "cache.url": getattr(config, "biotools_service_cache_url", config.database_connection), - "cache.table_name": getattr(config, "biotools_service_cache_table_name", "biotools_service_beaker_cache"), + "cache.table_name": getattr(config, "biotools_service_cache_table_name", None), "cache.schema_name": getattr(config, "biotools_service_cache_schema_name", None), } cache = CacheManager(**parse_cache_config_options(cache_opts)).get_cache("doi") diff --git a/test/unit/app/managers/test_CitationsManager_db.py b/test/unit/app/managers/test_CitationsManager_db.py index 7e7d66b59b5..2615cbfd462 100644 --- a/test/unit/app/managers/test_CitationsManager_db.py +++ b/test/unit/app/managers/test_CitationsManager_db.py @@ -13,7 +13,7 @@ class MockDoiCache(DoiCache): "cache.data_dir": getattr(config, "citation_cache_data_dir", None), "cache.lock_dir": getattr(config, "citation_cache_lock_dir", None), "cache.url": "sqlite://", - "cache.table_name": getattr(config, "citation_cache_table_name", "citation_beaker_cache"), + "cache.table_name": getattr(config, "citation_cache_table_name", None), "cache.schema_name": getattr(config, "citation_cache_schema_name", None), } self._cache = CacheManager(**parse_cache_config_options(cache_opts)).get_cache("doi")