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 multiple concurrent calls to install_and_run/2 (#58) #59

Merged
merged 2 commits into from
May 3, 2023

Conversation

azizk
Copy link
Contributor

@azizk azizk commented Apr 29, 2023

Fixes #58

I'm not sure if a Task.Supervisor should be used. WIP... 😄

Copy link
Member

@josevalim josevalim left a comment

Choose a reason for hiding this comment

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

You want the operation to be atomic, otherwise you have races. So you either need the worker to be a named GenServer or you need to spawn the task directly in a regular Supervisor and use a unique child spec ID to avoid duplicates. :)

@azizk azizk force-pushed the concurrent-install branch from 1e39bd8 to 9fac1d8 Compare May 3, 2023 00:02
@azizk
Copy link
Contributor Author

azizk commented May 3, 2023

Hope this is better? 😄

@josevalim josevalim marked this pull request as ready for review May 3, 2023 12:06
test/esbuild_test.exs Outdated Show resolved Hide resolved
@josevalim josevalim merged commit e2a24b4 into phoenixframework:main May 3, 2023
@josevalim
Copy link
Member

Glorious!

@azizk azizk deleted the concurrent-install branch May 3, 2023 19:14
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.

Multiple watchers create multiple downloads and a conflict when installing
2 participants