-
Notifications
You must be signed in to change notification settings - Fork 82
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
check hangs forever when parallel execution is on #129
Comments
@giampaolo would you be OK with having a look at this? I can look into it over the long weekend. I'm also planning to augment our test suite in CI to prevent regression. |
Mmm this is weird. Children exiting shouldn't cause parent to hang. |
I got this on macOS Monterey and also on Centos 7 |
Can you paste the content of all the py files you are linting? |
It can be reproduced with two files from the first post. Each file just needs to have one line of code, i.e. any import never used. |
I can repro with the following steps: % mkdir test_parallel
% echo "import sys" > test_parallel/file1.py
% cp test_parallel/file{1,2}.py
% autoflake --check test_parallel/*
test_parallel/file2.py: Unused imports/variables detected
test_parallel/file1.py: Unused imports/variables detected
# hangs Investigating it now, if I don't succeed I'll update with more info for others. |
Ok, the problem is that we're calling sys.exit and that blocks the pool. #133 fixes it. |
Also remove the AUTOFLAKE_COVERAGE stuff.
Hello. There is the following issue with parallel execution.
Suppose there are two files with unused imports:
test_parallel/test1.py
test_parallel/test2.py
When run a check executed in parallel (
-j 0
by default), it detects the unused imports, but then it hangs forever. And it needs keyboard interrupt to exit:Once child process exits after errors found, the main process just sits there waiting for something to be returned from the child process. But child have already exited, so there is nothing to return resulting in a forever wait.
The text was updated successfully, but these errors were encountered: