Skip to content

Do not use protocols during consolidation to avoid races #13856

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

Merged
merged 3 commits into from
Sep 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/elixir/lib/protocol.ex
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,8 @@ defmodule Protocol do

defp extract_matching_by_attribute(paths, prefix, callback) do
for path <- paths,
path = to_charlist(path),
# Do not use protocols as they may be consolidating
path = if(is_list(path), do: path, else: String.to_charlist(path)),
Copy link
Member

Choose a reason for hiding this comment

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

My 2c: a comment here would be worth it, because by reading this I’m afraid the first thought would be "oh with to_charlist/1 this could be simpler 😄

file <- list_dir(path),
mod = extract_from_file(path, file, prefix, callback),
do: mod
Expand Down
Loading