Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing an empty value channel to a process causes nextflow to hang #4940

Open
human9 opened this issue Apr 22, 2024 · 1 comment
Open

Passing an empty value channel to a process causes nextflow to hang #4940

human9 opened this issue Apr 22, 2024 · 1 comment

Comments

@human9
Copy link

human9 commented Apr 22, 2024

If a channel is created via channel.value() and passed directly to a process, nextflow hangs forever.

Expected behavior and actual behavior

I assumed that passing channel.value() would work for passing optional inputs that I always want to evaluate to false, as it seems to create a value channel with null as the value. But doing this will just hang the nextflow process with no error message.

I notice the docs specifically mention that channel.value(null) isn't allowed, which seems to result in identical behaviour to channel.value(). I also notice that passing null directly to a process results in an error message. So maybe the expected behaviour here is to throw the same error message instead of hanging?

Script to reproduce

process P {
 input:
 val empty

 exec:
 println empty
}

workflow {
 P(
  channel.value()
 )
}

Output (this doesn't error out, just hangs)

 N E X T F L O W   ~  version 24.03.0-edge
Launching `main.nf` [ecstatic_jepsen] DSL2 - revision: 0527d9bad8
[-        ] process > P -

.nextflow.log

Environment

  • Nextflow version: 24.03.0-edge
  • Java version: Temurin 21.0.2
  • Operating system: Ubuntu 24.04
  • Bash version: GNU bash, version 5.2.21(1)-release
@bentsherman
Copy link
Member

really I think channel.value() with no argument should not be allowed. there is already channel.empty() to create an empty queue channel which should terminate properly

optional process inputs should be handled by providing a default value such as an empty string or list. this is a bit ugly but I think it will be improved once we implement static typed process inputs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants