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

Fix pylint hang on file with many errors #380

Merged
merged 1 commit into from
May 17, 2023

Conversation

hetmankp
Copy link
Contributor

When pylint reports a large number of messages on a given file (200 should be sufficient on Linux), the returned output can exceed the maximum buffer size available to a pipe causing a deadlock as the pylint plugin waits for the pylint process to complete, while the pylint process waits for the pylint plugin to clear out the pipe. This hangs the pylint plugin and no linting is ever provided for the file.

This bug only exists when the plugin lints files from the file system and is not an issue when pylsp.plugins.pylint.executable has been configured due to a different code path being used.

When pylint reports a large number of messages on a given file (200
should be sufficient on Linux), the returned output can exceed the
maximum buffer size available to a pipe causing a deadlock as the pylint
plugin waits for the pylint process to complete, while the pylint
process waits for the pylint plugin to clear out the pipe. This hangs
the pylint plugin and no linting is ever provided for the file.

This bug only exists when the plugin lints files from the file system
and is not an issue when pylsp.plugins.pylint.executable has been
configured due to a different code path being used.
@ccordoba12 ccordoba12 added this to the v1.7.4 milestone May 16, 2023
Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks for your contribution @hetmankp!

@ccordoba12 ccordoba12 merged commit 297099c into python-lsp:develop May 17, 2023
10 checks passed
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Jul 5, 2023
## Version 1.7.4 (2023/06/29)

### Issues Closed

* [Issue 393](python-lsp/python-lsp-server#393) - Environment path doesn't expand user directory

In this release 1 issue was closed.

### Pull Requests Merged

* [PR 394](python-lsp/python-lsp-server#394) - Resolve homedir references in Jedi environment path, by [@odiroot](https://github.com/odiroot)
* [PR 381](python-lsp/python-lsp-server#381) - Report progress even when initialization fails, by [@syphar](https://github.com/syphar)
* [PR 380](python-lsp/python-lsp-server#380) - Fix pylint hang on file with many errors, by [@hetmankp](https://github.com/hetmankp)

In this release 3 pull requests were closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants