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

With --jobs 2, the open() call is executed for each opened file #7774

Closed
Pierre-Sassoulas opened this issue Nov 16, 2022 · 4 comments · Fixed by #8702 or #9093
Closed

With --jobs 2, the open() call is executed for each opened file #7774

Pierre-Sassoulas opened this issue Nov 16, 2022 · 4 comments · Fixed by #8702 or #9093

Comments

@Pierre-Sassoulas
Copy link
Member

Pierre-Sassoulas commented Nov 16, 2022

With --jobs 2, the open() call is executed for each opened file. E.g. for HomeAssistant I got over 16.000 warnings just for 3 old config values. That should be fixed before we release 2.16.

https://github.com/cdce8p/ha-core/actions/runs/3470026809/jobs/5797737991#step:8:25

pylint: Command line or configuration file:1: UserWarning: Specifying exception names in the overgeneral-exceptions option without module name is deprecated and support for it will be removed in pylint 3.0. Use fully qualified name (maybe 'builtins.BaseException' ?) instead.
pylint: Command line or configuration file:1: UserWarning: Specifying exception names in the overgeneral-exceptions option without module name is deprecated and support for it will be removed in pylint 3.0. Use fully qualified name (maybe 'builtins.Exception' ?) instead.
pylint: Command line or configuration file:1: UserWarning: Specifying exception names in the overgeneral-exceptions option without module name is deprecated and support for it will be removed in pylint 3.0. Use fully qualified name (maybe 'builtins.HomeAssistantError' ?) instead.
pylint: Command line or configuration file:1: UserWarning: Specifying exception names in the overgeneral-exceptions option without module name is deprecated and support for it will be removed in pylint 3.0. Use fully qualified name (maybe 'builtins.BaseException' ?) instead.
pylint: Command line or configuration file:1: UserWarning: Specifying exception names in the overgeneral-exceptions option without module name is deprecated and support for it will be removed in pylint 3.0. Use fully qualified name (maybe 'builtins.Exception' ?) instead.
pylint: Command line or configuration file:1: UserWarning: Specifying exception names in the overgeneral-exceptions option without module name is deprecated and support for it will be removed in pylint 3.0. Use fully qualified name (maybe 'builtins.HomeAssistantError' ?) instead.
pylint: Command line or configuration file:1: UserWarning: Specifying exception names in the overgeneral-exceptions option without module name is deprecated and support for it will be removed in pylint 3.0. Use fully qualified name (maybe 'builtins.BaseException' ?) instead.
pylint: Command line or configuration file:1: UserWarning: Specifying exception names in the overgeneral-exceptions option without module name is deprecated and support for it will be removed in pylint 3.0. Use fully qualified name (maybe 'builtins.Exception' ?) instead.
pylint: Command line or configuration file:1: UserWarning: Specifying exception names in the overgeneral-exceptions option without module name is deprecated and support for it will be removed in pylint 3.0. Use fully qualified name (maybe 'builtins.HomeAssistantError' ?) instead.
pylint: Command line or configuration file:1: UserWarning: Specifying exception names in the overgeneral-exceptions option without module name is deprecated and support for it will be removed in pylint 3.0. Use fully qualified name (maybe 'builtins.BaseException' ?) instead.

Originally posted by @cdce8p in #7497 (comment)

@Pierre-Sassoulas Pierre-Sassoulas added the Blocker 🙅 Blocks the next release label Nov 16, 2022
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.16.0 milestone Nov 16, 2022
@Pierre-Sassoulas Pierre-Sassoulas changed the title With --jobs 2, the open() call is executed for each opened file. E.g. for HomeAssistant I got over 16.000 warnings just for 3 old config values. That should be fixed before we release 2.16. With --jobs 2, the open() call is executed for each opened file Nov 16, 2022
@jacobtylerwalls
Copy link
Member

I don't think we will be able to refactor the parallelism to avoid calling open() before 2.16, that's a huge task for 3.0. To fix the blocker, maybe we can add a warnings filter "once" around our own warning ... is that feasible?

@Pierre-Sassoulas

This comment was marked as off-topic.

@Pierre-Sassoulas
Copy link
Member Author

I did some research this is indeed more complicated than I though, as no simple filter work work on process pool executor. Here's a simple reproducer:

import warnings
from concurrent.futures import ProcessPoolExecutor


def a_warning():
    warnings.warn("Hello filter my old friend.")


with ProcessPoolExecutor(max_workers=10, initializer=a_warning) as executor:
    warnings.simplefilter("once")
    executor.submit(a_warning)

I'm going to remove the blocker, this is something that is going to happen once and spam you for the number of job you defined, we can probably live with it.

@Pierre-Sassoulas Pierre-Sassoulas added Enhancement ✨ Improvement to a component Minor 💅 Polishing pylint is always nice and removed Blocker 🙅 Blocks the next release Unreleased labels Jan 12, 2023
@Pierre-Sassoulas Pierre-Sassoulas removed this from the 2.16.0 milestone Jan 12, 2023
@licui7
Copy link

licui7 commented Feb 3, 2023

I have this bug even with python v3.10.9 for pylint v2.16.0. This bug is gone with pylint 2.16.1 though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants