-
Notifications
You must be signed in to change notification settings - Fork 646
Linting concurrency should be limited #1916
Comments
This is different than #1890 Your case is about killing an older linting process before starting a new one. If you look at https://github.com/Microsoft/vscode-go/blob/0.6.89/src/goLint.ts, you will see that we do indeed cancel the current running linting process before starting a new one. So I dont see why you would see multiple processes running for the linter, unless the specific linter itself is spawning new processes. Can you try setting your lint tool as |
Yes, it's the same with
"go.lintTool": "golint",
"go.lintOnSave": "workspace",
|
Does it also happen when |
This issue has been closed automatically because it needs more information and has not had recent activity. Thank you for your contributions. |
The only reason why it is hard to notice that with
Please reopen. |
Is the above after multiple saves or for the single save? |
I am currently a bit swamped. Do you mind debugging this by running the Go extension from the source? Its pretty straight forward If you are up for it, then follow the below instructions:
|
After multiple saves. |
Is this up for grabs? I can have a look at it, if available. |
Go ahead! And thank you. |
I would like to add that the My operating system is Solus Linux if that makes a difference. To reproduce the issue, clone any decent size Go project and execute the |
@mk0a1a Your particular scenario is being tracked in #2202 and is fixed in the latest beta version of this extension where the on save feature is invoked only the file that is in the active editor. @AlekSi Was your issue also seen only when saving multiple files at once? |
No, my issues about multiple saves of a single file. |
@AlekSi We last left things at Would you have some time to look deeper into why you would have multiple linters running? |
Multiple linters are easily triggered when When multiple linters are running, my VScode barely gets any CPU power, causing the UI running at ~2fps. |
@m13253 Like I said before, we do have code in place that is meant to cancel processes that were spawned for previous linting attempts when a new linting request is in place. Can you follow |
Thank you for your quick response. By the way, I want to propose another logic which doesn't involve canceling or killing, since as long as I know, canceling tokens are somewhat not 100% reliable:
This logic is to ensure that if multiple linting requests are requested, the running one is not interrupted (and whose results may be useful), and the excessive ones are suppressed except the latest request. |
Such results may also be stale if subsequent edits to the file have already fixed the linting warnings. |
Since this issue has not had much activity for the last year, I will close it in favor of a new umbrella issue for improving VS Code Go's handling of subprocesses: #3044. It will be easier to track improvements with one issue, instead of many hard-to-find ones. As an alternative, you can use the language server, which handles cancellation. |
Duplicate of #3044 |
vscode-go version: 0.6.89
This issue is similar to #1890, but I think it is separate. Please close it if it's not.
If I edit and save file faster then my linter (golangci-lint in my case) finishes, another process will be created. Even with custom flags (
--concurrency=1 --fast
to limit GOMAXPROCS and run only fast linters) several concurrent processes slow down everything.I think it doesn't make sense to run several linters concurrently. So I propose to SIGTERM previous linter process before spawning a new one or schedule a new process to start after the previous one finishes.
The text was updated successfully, but these errors were encountered: