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

Data race when running scripts concurrently #358

Open
brutella opened this issue Oct 13, 2023 · 3 comments · May be fixed by #359
Open

Data race when running scripts concurrently #358

brutella opened this issue Oct 13, 2023 · 3 comments · May be fixed by #359

Comments

@brutella
Copy link
Contributor

When I run multiple scripts concurrently, I get a data race when the global variables Packages and PackageTypes are accessed here and here.

I add and remove packages from env.Packages and env.PackageTypes before a script is executed. That's why I get a data race because the access to those global variables is not synchronised. I was able to fix this issue by allowing packages to be defined on an environment level – see pull request below.

Might be related to #34

brutella added a commit to brutella/anko that referenced this issue Oct 13, 2023
This change enables environments to have a different set of
packages. Accessing a package can now be protected by the environment mutex.

Fixes mattn#358
@brutella brutella linked a pull request Oct 13, 2023 that will close this issue
@mattn
Copy link
Owner

mattn commented Oct 14, 2023

Thanks. Could you please add tests?

@brutella
Copy link
Contributor Author

Done

@brutella
Copy link
Contributor Author

@mattn Any chance to get this merged?

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 a pull request may close this issue.

2 participants