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

Ensure we don't modify a shared env #452

Merged
merged 3 commits into from
Dec 31, 2023
Merged

Ensure we don't modify a shared env #452

merged 3 commits into from
Dec 31, 2023

Conversation

withinboredom
Copy link
Collaborator

If env is passed into startWorkers(), then workers will try to both set env["FRANKENPHP_WORKER"] = "1" at the same time, which causes a data race.

This PR updates the env before any workers start, ensuring there isn't a data race.

Copy link
Owner

@dunglas dunglas left a comment

Choose a reason for hiding this comment

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

Good catch!

worker.go Outdated Show resolved Hide resolved
Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
worker.go Outdated Show resolved Hide resolved
Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
@withinboredom withinboredom merged commit 7830aae into main Dec 31, 2023
38 of 40 checks passed
@withinboredom withinboredom deleted the fix/data-race branch December 31, 2023 19:02
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.

None yet

2 participants