From b388b81f7b8f046317cb838514b04227a26dd8e1 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Mon, 13 May 2024 15:11:57 +0200 Subject: [PATCH 01/13] Drop unnecessary commit() call --- lib/galaxy/job_execution/actions/post.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/galaxy/job_execution/actions/post.py b/lib/galaxy/job_execution/actions/post.py index 10c1e3a57071..8fd85e03dd47 100644 --- a/lib/galaxy/job_execution/actions/post.py +++ b/lib/galaxy/job_execution/actions/post.py @@ -8,7 +8,6 @@ from markupsafe import escape from galaxy.model import PostJobActionAssociation -from galaxy.model.base import transaction from galaxy.util import send_mail from galaxy.util.custom_logging import get_logger @@ -370,8 +369,6 @@ def execute(cls, app, sa_session, action, job, replacement_dict, final_job_state # POTENTIAL ISSUES: When many outputs are being finish()ed # concurrently, sometimes non-terminal steps won't be cleaned up # because of the lag in job state updates. - with transaction(sa_session): - sa_session.commit() if not job.workflow_invocation_step: log.debug("This job is not part of a workflow invocation, delete intermediates aborted.") return From 2950ae6ab9bd7f98f56c3dba2ec7796eed16ec84 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Mon, 13 May 2024 16:01:38 +0200 Subject: [PATCH 02/13] Fix addition of default collection to history --- lib/galaxy/tools/parameters/basic.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/tools/parameters/basic.py b/lib/galaxy/tools/parameters/basic.py index 62b29613d1fe..61cb868854d6 100644 --- a/lib/galaxy/tools/parameters/basic.py +++ b/lib/galaxy/tools/parameters/basic.py @@ -2737,6 +2737,7 @@ def raw_to_galaxy(trans, as_dict_value): name=name, collection=collection, ) + app.model.session.add(hdca) def write_elements_to_collection(has_elements, collection_builder): element_dicts = has_elements.get("elements") @@ -2753,8 +2754,9 @@ def write_elements_to_collection(has_elements, collection_builder): collection_builder = builder.BoundCollectionBuilder(collection) write_elements_to_collection(as_dict_value, collection_builder) collection_builder.populate() - trans.sa_session.add(hdca) - trans.sa_session.flush() + history.stage_addition(hdca) + history.add_pending_items() + app.model.session.flush() return hdca From 25f8d7ec1d86dba2c16e0ade2f185fa9730090aa Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Tue, 14 May 2024 10:31:42 +0200 Subject: [PATCH 03/13] Don't flush for inner elements --- lib/galaxy/tools/parameters/basic.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/galaxy/tools/parameters/basic.py b/lib/galaxy/tools/parameters/basic.py index 61cb868854d6..dbe1b065a243 100644 --- a/lib/galaxy/tools/parameters/basic.py +++ b/lib/galaxy/tools/parameters/basic.py @@ -2675,7 +2675,7 @@ def to_text(self, value): # Code from CWL branch to massage in order to be shared across tools and workflows, # and for CWL artifacts as well as Galaxy ones. -def raw_to_galaxy(trans, as_dict_value): +def raw_to_galaxy(trans, as_dict_value, commit=True): app = trans.app history = trans.history @@ -2725,7 +2725,8 @@ def raw_to_galaxy(trans, as_dict_value): trans.sa_session.add(primary_data) history.stage_addition(primary_data) history.add_pending_items() - trans.sa_session.flush() + if commit: + app.model.session.commit() return primary_data else: name = as_dict_value.get("name") @@ -2745,7 +2746,8 @@ def write_elements_to_collection(has_elements, collection_builder): element_class = element_dict["class"] identifier = element_dict["identifier"] if element_class == "File": - hda = raw_to_galaxy(trans, element_dict) + # Don't commit for inner elements + hda = raw_to_galaxy(trans, element_dict, commit=False) collection_builder.add_dataset(identifier, hda) else: subcollection_builder = collection_builder.get_level(identifier) @@ -2756,7 +2758,8 @@ def write_elements_to_collection(has_elements, collection_builder): collection_builder.populate() history.stage_addition(hdca) history.add_pending_items() - app.model.session.flush() + if commit: + app.model.session.commit() return hdca From 48e1eda42e21d8080a2dd925b7f800f9e2a05d90 Mon Sep 17 00:00:00 2001 From: Ahmed Awan Date: Tue, 14 May 2024 12:01:13 -0500 Subject: [PATCH 04/13] [24.0] Fix undefined `reading 'produces_entry_points'` TypeError Fixes https://github.com/galaxyproject/galaxy/issues/18138 --- client/src/components/Tool/ToolSuccess.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/Tool/ToolSuccess.vue b/client/src/components/Tool/ToolSuccess.vue index 9f039b71598e..30da140a0980 100644 --- a/client/src/components/Tool/ToolSuccess.vue +++ b/client/src/components/Tool/ToolSuccess.vue @@ -31,7 +31,7 @@ onMounted(() => {