Multiple processes not used when list of explicit filenames is passed
See original GitHub issueSearch before asking
- I searched the issues and found no similar issues.
What Happened
When providing a long list of file names to sqlfluff lint -p -1
, only a single CPU is used. This seems to stem from the fact that https://github.com/sqlfluff/sqlfluff/blob/a006378af8b670f9235653694dbcddd4c62d1ab9/src/sqlfluff/core/linter/linter.py#L1190 is iterating over the list of files. For each listed path there, it would run the found files in parallel. As we are inputting whole filenames here, a path equals a single file and thus sqlfluff
would only process one file at a time.
The context here is the execution of sqlfluff lint
inside a pre-commit
hook.
Expected Behaviour
All CPU cores are used as -p -1
is passed on the commandline.
Observed Behaviour
Only a single CPU core is used.
How to reproduce
Run sqlfluff lint -p -1
with a long list of files.
Dialect
Affects all.
Version
1.4.2
Configuration
None.
Are you willing to work on and submit a PR to address the issue?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project’s Code of Conduct
Issue Analytics
- State:
- Created 10 months ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
multiprocessing — Process-based parallelism — Python 3.11 ...
The multiprocessing module also introduces APIs which do not have analogs in ... Using a list or tuple as the args argument passed...
Read more >Operating Systems: Processes
Many modern process concepts are still expressed in terms of jobs, ( e.g. job scheduling ), and the two terms are often used...
Read more >How do get a list of all the names of files transferred in a ...
1) Open Automation Web Admin. 2) Go to Tasks and open a task. 3) Click "Step" and "Add a Process." 4) Choose the...
Read more >Assignment Two
This allows any set of processes to exchange information by using a public pipe whose end names are filenames. When a process uses...
Read more >Choosing Names for Processes and Files - Oracle Help Center
Choosing meaningful names helps you differentiate among multiple processes and files in displays, error logs, and external monitoring programs. In addition, it ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ll take a look, sure!
Thank you, this is working nicely!