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 'no plugins found' bug on python > 3.7 #482

Conversation

Ian288
Copy link

@Ian288 Ian288 commented Sep 16, 2021

Fixes the 'no plugins found' bug on python > 3.7 by explicitly passing
the current settings object to an initialization function that runs
before the multiprocessing job is started. This initialization creates a
new settings object for that process and sets its properties equal to
that of the settings object passed from the parent process.

Fixes the 'no plugins found' bug on python > 3.7 by explicitly passing
the current settings object to an initialization function that runs
before the multiprocessing job is started. This initialization creates a
new settings object for that process and sets its properties equal to
that of the settings object passed from the parent process.
Copy link
Contributor

@domanchi domanchi left a comment

Choose a reason for hiding this comment

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

After many months of this bug being live in production, thank you @Ian288 for finally contributing a PR to fix this!

Comment on lines +95 to +96
initializer=initialize_settings,
initargs=(get_settings(),),
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
initializer=initialize_settings,
initargs=(get_settings(),),
initializer=configure_settings_from_baseline,
initargs=(get_settings().json(),),

Instead of passing around Python objects (and repeating the logic found in detect_secrets.settings.configure_settings_from_baseline), does this work instead?

Or, if we wanted to optimize it even more, we can create the JSON representation once, and pass it into initargs.

@jpdakran
Copy link
Member

jpdakran commented Feb 7, 2022

Closing as this was merged as part of #505

@jpdakran jpdakran closed this Feb 7, 2022
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.

4 participants