Open da-i opened 1 month ago
Are you using recursion somewhere in your pipeline?
I was initially, but i disabled in a test before submitting, see #Additional context
But even if you distill it down to its core, it does not work:
input_folder = "test_in/"
read_pattern = "**.{fq,fastq,fq.gz,fastq.gz}"
stop_pattern = "{seq*,DONE}.txt"
process StopCondition {
input:
path(input_file)
output:
path("*.txt")
"""
echo "hi" >> hi.txt
"""
}
workflow {
read_pattern = "${input_folder}${read_pattern}"
stop_pattern = "${input_folder}${stop_pattern}"
log.info """Looking for files with: $read_pattern"""
log.info """Going until files with pattern: $stop_pattern"""
stop_file_found = true
stop_files = Channel.watchPath(stop_pattern,'create,modify').until{ stop_file_found }
stop_files.filter{ it -> it.simpleName !=~ 'seq*DONE.txt'}
stop_files.dump(tag: "stop-files-rt")
StopCondition(stop_files)
}%
Never exits.
Bug report & Expected behavior and actual behavior
I was testing the option to watch two separate folders for different input files. When building a proof of concept workflow i found an issue where the workflow does no longer accept any data, but does not exit, and just hangs.
The idea is to wait for a certain file with a different regex pattern and when it sees that stop the pipeline. This approach resulted from the fact that you are not allowed to nest regex patterns (which i get, as it is far from ideal in most cases). So as a workaround we create a file with a certain name in the input directory, as i could not get any other method to work.
Steps to reproduce the problem
Some code:
where we import StopConditionInitial and StopCondition from:
Not the most elegant solution with respect of the $stop_reason == 'empty', build was testing if this works :).
Program output
When i run this
NOTE: i created a stop file after a bit. The .nextflow.log shows:
And then nothing happens and it just sits there. even if we add files matching to the read_input pattern or stopfile pattern.
Same kind of output when the StopFilesInitial is not empty.
When we remove the block:
Everything works!
Environment
Additional context
disabling
nextflow.preview.recursion
does not resolve the issue.