Delay tool exec for discovered & mapped-over input

We should only finalize collections up until the map over depth,
as indicated by the TODO that is now obsolete.
Fixes https://github.com/galaxyproject/galaxy/issues/5867 and probably
a bunch of other issues where workflows don't run to completion.
This commit is contained in:
mvdbeek
2019-03-31 13:56:42 +02:00
parent 0f80279092
commit 95fc75078f
2 changed files with 6 additions and 5 deletions
+3 -4
View File
@@ -3445,14 +3445,13 @@ class DatasetCollection(Dictifiable, UsesAnnotations, RepresentById):
self.populated_state = DatasetCollection.populated_states.FAILED
self.populated_state_message = message
def finalize(self):
def finalize(self, collection_type_description):
# All jobs have written out their elements - everything should be populated
# but might not be - check that second case! (TODO)
self.mark_as_populated()
if self.has_subcollections:
# THIS IS WRONG - SHOULD ONLY BE TO THE DEPTH OF THE MAP OVER.
if self.has_subcollections and collection_type_description.has_subcollections():
for element in self.elements:
element.child_collection.finalize()
element.child_collection.finalize(collection_type_description.child_collection_type_description())
@property
def dataset_instances(self):
+3 -1
View File
@@ -314,7 +314,9 @@ class ExecutionTracker(object):
implicit_collection_jobs = implicit_collection.implicit_collection_jobs
implicit_collection_jobs.populated_state = "ok"
trans.sa_session.add(implicit_collection_jobs)
implicit_collection.collection.finalize()
implicit_collection.collection.finalize(
collection_type_description=self.collection_info.structure.collection_type_description
)
trans.sa_session.add(implicit_collection.collection)
trans.sa_session.flush()