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(inputs.mysql): Avoid side-effects for TLS between plugin instances #12576

Merged
merged 5 commits into from
Jan 31, 2023

Conversation

srebhan
Copy link
Contributor

@srebhan srebhan commented Jan 31, 2023

Currently, the plugin registers its TLS configuration as key "custom" to the MySQL driver. However, this registration is global to the driver package and therefor potential side-effects between multiple plugin instances arise if those instances register different TLS configurations.

This PR fixes the issue by replacing the "custom" key with a unique key while keeping the user-facing configuration the same. Furthermore, we move the initialization to the Init() function in order to save some cycles and avoid the necessity to frequently create random registrations.

@telegraf-tiger telegraf-tiger bot added area/mysql fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Jan 31, 2023
@telegraf-tiger
Copy link
Contributor

@srebhan srebhan added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Jan 31, 2023
Copy link
Contributor

@powersj powersj left a comment

Choose a reason for hiding this comment

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

Thanks - while we don't have any integration tests that us TLS directly, they would cover the bulk of the path

@powersj powersj merged commit e6655d5 into influxdata:master Jan 31, 2023
powersj pushed a commit that referenced this pull request Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/mysql fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants