Closed vaheg55 closed 1 year ago
I think the problem is that stage_ensemble_evaluate
gets added as a follow-on of stage_sample_new_configurations
, and tries to use the return value of stage_sample_new_configurations
. But stage_sample_new_configurations
returns the return value of a different follow-on of itself, namely stage_merge_files
. So once stage_sample_new_configurations
runs, Toil sees stage_ensemble_evaluate
and stage_merge_files
as both equally ready to run, and will arbitrarily pick one to run first. But actually, to work properly, stage_merge_files
has to run first.
I think the simplest way to fix this might be to change stage_sample_new_configurations
so that stage_merge_files
runs as part of its children, and not as a follow-on, since stage_merge_files
is conceptually inside stage_sample_new_configurations
. So change:
j2 = Job.wrapJobFn(stage_merge_files, [j.rv() for j in jobs])
job.addFollowOn(j2)
return j2.rv()
To something like:
j2 = Job.wrapJobFn(stage_merge_files, [j.rv() for j in jobs])
for j in jobs:
j.addFollowOn(j2)
job.addChild(j2)
return j2.rv()
Then stage_merge_files
is a child of stage_sample_new_configurations
, but still constrained to happen after the jobs it is merging, and the return value of stage_sample_new_configurations
will be available to its follow-ons.
Does that help?
Yep, I think that fixed it. Thanks.
I'm getting a weird error in my workflow, where a follow-on job is being run before all of its required promises have been fulfilled. This is a minimal example that reproduces the error:
This is the error message:
┆Issue is synchronized with this Jira Story ┆Issue Number: TOIL-1395