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

False positives probably related to caching #392

Closed
DervishD opened this issue Sep 19, 2023 · 7 comments
Closed

False positives probably related to caching #392

DervishD opened this issue Sep 19, 2023 · 7 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster triage-needed Issue is not triaged.

Comments

@DervishD
Copy link

I've reported the bug on the pylint-dev repo, at pylint-dev/pylint/issues/9047 but I'm reporting it here too because it seems to be related to pylint bein used in server mode by the extension, as in #132 and #129 .

You can see the details about my environment, etc. in the linked pylint-dev issue. I'm not repeating everything here to save a bit of noise and to not change any information by mistake.

The code I've been using to reproduce the code is quite weird, it is already posted in the pylint-dev issue, and more importantly, it is useless for reliably reproducing the bug, as it does not happen consistently. Fast saves in long code, long and complex code, etc. seem to trigger the issue, but I cannot reproduce it consistently.

I've tested with the embedded interpreter and one installed in my environment and the results are the same: from time to time I get spurious errors (in my case E0710 and E0712) because I think the server is not getting all the code, and the part where the custom exceptions are declared and derived from Exception does not get into the server or is ignored or something like that, causing the error to appear.

The errors are fixed as soon as I restart the server by hand using the command palette. They reappear sooner than later, but at least they go away for some time.

I'm reporting it here just in case someone searches for the issue, so there is at least some information available in the relevant repositories.

Anyway, if anyone is aware of caching problems or known bugs that can be worked-around, I'm all ears because this is very uncomfortable, having to restart the server or even Visual Studio Code to have proper linting reports.

Thanks a lot in advance and feel free to ask me if more information is needed.

@github-actions github-actions bot added the triage-needed Issue is not triaged. label Sep 19, 2023
@karthiknadig karthiknadig self-assigned this Sep 19, 2023
@karthiknadig
Copy link
Member

@DervishD There is a setting "pylint.trace.server": "verbose", that can be added to see if the errors are being reported before synchronization. Also, note that pylint extension has an experimental feature to lint on change. If you are in the experiment it might be sending details as the content is being edited. You can turn this off by explicitly setting the pylint.lintOnChange to false.

The trace setting captures content that is being sent to the server and we should be able to see if this is due to synchronization issue.

@karthiknadig karthiknadig added bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster labels Sep 29, 2023
@DervishD
Copy link
Author

DervishD commented Oct 2, 2023

@karthiknadig thanks A LOT for the information and advice. Right now I'm quite busy for testing this properly, so my first try will be disabling pylint.lintOnChange. If that solves the issue, I'll try to generate a verbose log with your instructions as soon as I can. This week is going to be a bit mad for me, so if I don't provide the verbose trace is not because I'm not interested or involved, it's just I don't have the time I need to do it, but I'll do it as soon as I can.

@DervishD
Copy link
Author

DervishD commented Oct 3, 2023

@karthiknadig a small update: the problem still happens with pylint.lintOnChange set to false, but it takes more time to appear. This can be a false impression of mine, though, because as far as I know I'm not using the experimental version.

My next step will be setting the verbose flag and dump the report, as soon as I can.

@DervishD
Copy link
Author

DervishD commented Oct 4, 2023

@karthiknadig I added "pylint.trace.server": "verbose" to my configuration and relaunched vscode. I have saved the server output to a file, but I'm not sure if this is what you need or not.

If you need me to do a different thing or sending you a different content, please tell me.

Also, even though this is by no means a "secret" project (it is, in fact one of my public repositories), the contents of the file may reveal local paths of my development machine which I may want to obscure, if you don't mind, before adding the trace file here.

In short, I may need some instructions 👼🏼 Thanks a lot!

@karthiknadig
Copy link
Member

@DervishD Can you use the latest version of the extension? There was a bug that was addressed related to this #414

@DervishD
Copy link
Author

@karthiknadig as soon as I can, probably tomorrow morning before start coding 😄 Thanks A LOT!

Anyway, the problem has not happened again, probably because I'm now working with a simpler version of the code (I'm refactoring it) so for any reason it is not triggering the bug.

I'll try the new version ASAP and if it happens again I'll have a report ready.

@DervishD
Copy link
Author

I have not been able to reproduce the issue with latest version, so I'm closing the issue for the time being, if that is not overstepping. Thanks a lot for the help and the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster triage-needed Issue is not triaged.
Projects
None yet
Development

No branches or pull requests

2 participants