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

ConcurrentModificationException with unclear origin #5826

Open
mahesh-panchal opened this issue Feb 28, 2025 · 1 comment
Open

ConcurrentModificationException with unclear origin #5826

mahesh-panchal opened this issue Feb 28, 2025 · 1 comment

Comments

@mahesh-panchal
Copy link
Contributor

Bug report

The workflow exits with a ConcurrentModificationException, and it's not clear where this is happening.

Expected behavior and actual behavior

The expected behaviour is that no Exception is thrown.
The actual behaviour non-consistent throwing of this ConcurrentModificationException.

Steps to reproduce the problem

I can't recreate this with a toy as I really have no idea what the underlying cause is.

Program output

There's at least a stack trace in this one after removing the when: section of code.
nextflow.log

At first it was reporting an error in the wrong place. Something to do with the when: section, but this was a red herring.

nextflow.2.log

nextflow.3.log

Environment

  • Nextflow version: 24.10.4
  • Java version: openjdk 21-internal 2023-09-19
  • Operating system: Linux
  • Bash version: GNU bash, version 4.4.23(1)-release (x86_64-suse-linux-gnu)

Additional context

Normally these ConcurrentModificationExceptions occur when modifying meta map data like

meta.id = 'some value'

instead of doing

meta + [id: 'some value']

which returns a new map.

But here the meta map is intialized at the start of the workflow, and the submap where the exception is thrown is not modified at all where the error is being thrown. I'm wondering if it's something to do with using nested maps to group meta data, but this was working fine up until some point and then various problems with the meta data started occurring. I have no idea if it coincides with a version change as we were using a shared conda environment, and then someone might have updated it although I don't know when.

I also asked for help on Slack: https://nextflow.slack.com/archives/C02T98A23U7/p1740668070269849 but I don't think we got anywhere.

@mahesh-panchal
Copy link
Contributor Author

After stripping out the when:, it's also throwing this in other processes, but it's consistently reporting a line with task.ext (task.ext.when or task.ext.args after the task.ext.when is taken out)

The workflow crashed on an nf-core busco module, and reported the error at line 33 which corresponds to the task.ext.args

    script:
    if ( mode !in [ 'genome', 'proteins', 'transcriptome' ] ) {
        error "Mode must be one of 'genome', 'proteins', or 'transcriptome'."
    }
    def args = task.ext.args ?: ''
    def prefix = task.ext.prefix ?: "${meta.id}-${lineage}"

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

No branches or pull requests

1 participant