question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple processes not used when list of explicit filenames is passed

See original GitHub issue

Search 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

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
barrywhartcommented, Nov 18, 2022

I’ll take a look, sure!

0reactions
xhochycommented, Dec 20, 2022

Thank you, this is working nicely!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found