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

Work around Windows problem by using dummy pool for jobs=1 #436

Merged
merged 1 commit into from
Jan 27, 2021

Conversation

Zac-HD
Copy link
Contributor

@Zac-HD Zac-HD commented Dec 21, 2020

Per #435, any codemod which is implemented with a lambda cannot be run on more than one file at time. That's because pickle limitations mean we can't use a process pool, and so this patch ensures that we don't use a process pool for jobs=1 and thus enables a "just run serially" workaround.

This is also something of a performance optimisation, since starting a single process to do all the work is likely to take longer than just doing it in the current process.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 21, 2020
@codecov-io
Copy link

Codecov Report

Merging #436 (4deb245) into master (df231f3) will not change coverage.
The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #436   +/-   ##
=======================================
  Coverage   94.30%   94.30%           
=======================================
  Files         232      232           
  Lines       22669    22669           
=======================================
  Hits        21379    21379           
  Misses       1290     1290           
Impacted Files Coverage Δ
libcst/codemod/_cli.py 28.19% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update df231f3...4deb245. Read the comment docs.

Copy link
Member

@zsol zsol left a comment

Choose a reason for hiding this comment

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

Seems reasonable. Thx for the fix!

@zsol zsol merged commit 546f628 into Instagram:master Jan 27, 2021
@Zac-HD Zac-HD deleted the single-process branch January 27, 2021 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants