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

Ecto.Repo.Supervisor.compile_config/2 should use ensure_compiled? instead of ensure_loaded? #2822

Closed
evadne opened this issue Nov 18, 2018 · 0 comments

Comments

@evadne
Copy link
Contributor

evadne commented Nov 18, 2018

  • Elixir version (elixir -v): 1.7.4
  • Ecto version (mix deps): 3.x
  • Operating system: macOS

Current behaviour

Currently Ecto.Repo.Supervisor.compile_config/2 uses Code.ensure_loaded?/1 which is fine in most cases, when the adapter lives elsewhere, and would possibly have been compiled already as part of a dependency. But this can be wobbly when both the Repo and the Adapter it refers to are in the same OTP app. When I do this and repeatedly run mix compile on a machine with 8 cores, this fails 50% of the time but never fails during the first compilation pass after running mix clean.

Upon consulting Elixir Documentation on code loading I believe this call should be changed. Once this is changed the wobbliness is no more.

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

2 participants