Skip to content

Conversation

@Edouard-chin
Copy link
Contributor

What was the end-user or developer problem that led to this PR?

In #9100, I opened a patch to run git operations in parallel in order to download git gems more quickly. The parallelization doesn't work when resolving is not needed due to a premature call to source.specs hit by a different codepath.

You can reproduce the problem and see that the gems aren't downloaded in parallel if you have an existing Gemfile and Gemfile.lock. (In my first patch, I forgot to try when a Gemfile.lock already existed).

What is your fix for the problem, implemented in this PR?

I'd like to introduce a new call to preload_git_sources, when bundler hits the "missing specs" branch. I unfortunately couldn't find a single place where we could preload git sources due to the source.specs that is called at different path.

Make sure the following tasks are checked

- In ruby#9100, I opened a patch to run git operations in parallel in
  order to download git gems more quickly.
  The parallelization doesn't works when resolving is not needed due
  to a premature call to `source.specs` hit by this codepath.

  You can reproduce the problem and see that the gems aren't
  downloaded in parallel if you have an existing Gemfile and
  Gemfile.lock. (In my first patch, I forgot to try when a
  Gemfile.lock already existed).

  I'd like to introduce a new call to `prelad_git_sources`, when
  bundler hits the "missing specs" branch.
  I unforunately couldn't find a single place where we could preload
  git sources due to the `source.specs` that is called at different
  path.
Comment on lines 1136 to 1138
ensure
preload_git_source_worker.stop
end
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if this is expected but this ensure block still gets called, even with the early return.

def test
  return
ensure
  puts "hi there!"
end

test
=> "hi there!"

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.

2 participants