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

Fix using samplesheetToList multiple times in channel operators #65

Merged
merged 3 commits into from
Oct 22, 2024

Conversation

nvnieuwk
Copy link
Collaborator

Fixes #55

@awgymer
Copy link
Collaborator

awgymer commented Oct 21, 2024

Which part of this was actually the bug?

Copy link
Collaborator

@awgymer awgymer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All makes sense but would be good to understand why the values were being cached so we don't run into similar issues elsewhere in future?

@nvnieuwk
Copy link
Collaborator Author

I think it's caused by the parallelization of the channel operators. Even though the SamplesheetConverter gets created for every invokation of samplesheetToList it somehow seems to be able to interact with all instances of it. So I think it's just best to only have values that will be the same for all uses of the function (like the config in this case) and simply pass the values that can be changed as inputs to the functions. But maybe @bentsherman can help us out here?

@nvnieuwk nvnieuwk merged commit 9f6c2b2 into 2.2.0-dev Oct 22, 2024
4 checks passed
@nvnieuwk nvnieuwk deleted the fix/multiple-samplesheetToList branch October 22, 2024 10:47
@bentsherman
Copy link
Member

It could be parallel if you call samplesheetToList in a process, or across multiple different operators. In that case you should see if your SamplesheetConverter class is using shared variables (i.e. static variables) because that could cause a race condition

@nvnieuwk
Copy link
Collaborator Author

Yes that was the problem indeed, it got fixed by removing those and passing them as inputs to the desired functions instead

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

Successfully merging this pull request may close these issues.

3 participants