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

Add command line option to explicitly disable lock_wait_timeout (adds possibility to opt out of breaking changes with older versions) #896

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

festeveira
Copy link

@festeveira festeveira commented Nov 21, 2024

This PR adds a command line option to the exporter allowing the user to disable the lock_wait_timeout MySQL connection parameter making the exporter work again with older versions of mysql, while still behaving the same way by default.

Was really helpful for me, I need to monitor several instances in multi target mode and most of them are unsupported versions. Unless you see a problem with this I think it would be nice to have it merged.

Francisco Esteveira added 3 commits November 21, 2024 19:07
Signed-off-by: Francisco Esteveira <[email protected]>
Signed-off-by: Francisco Esteveira <[email protected]>
@festeveira festeveira changed the title Set lock_wait_timeout option only if positive Set lock_wait_timeout option only if positive (adds possibility to opt out of breaking changes with older versions) Jan 17, 2025
@SuperQ
Copy link
Member

SuperQ commented Feb 19, 2025

I'm not generally a fan of "magic values" like this. I prefer more explicit settings.

@festeveira festeveira changed the title Set lock_wait_timeout option only if positive (adds possibility to opt out of breaking changes with older versions) Add command line option to explicitly disable lock_wait_timeout (adds possibility to opt out of breaking changes with older versions) Feb 20, 2025
@festeveira
Copy link
Author

Hello, thank you for your feedback! I have added a command line parameter to explicitly disable the option. What do you think?

README.md Outdated
@@ -145,6 +145,7 @@ mysqld.username | Username to be used for connecting
config.my-cnf | Path to .my.cnf file to read MySQL credentials from. (default: `~/.my.cnf`)
log.level | Logging verbosity (default: info)
exporter.lock_wait_timeout | Set a lock_wait_timeout (in seconds) on the connection to avoid long metadata locking. (default: 2)
exporter.disable_lock_wait_timeout | Disable the lock_wait_timeout connection parameter. Makes the exporter compatible with older versions of MySQL. (default: false)
Copy link
Member

Choose a reason for hiding this comment

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

I prefer "positive" flags, so that we don't have double negative behavior.

The disable would be --no-exporter.enable_lock_wait_timeout.

Suggested change
exporter.disable_lock_wait_timeout | Disable the lock_wait_timeout connection parameter. Makes the exporter compatible with older versions of MySQL. (default: false)
exporter.enable_lock_wait_timeout | Disable the lock_wait_timeout connection parameter. Makes the exporter compatible with older versions of MySQL. (default: true)

@SuperQ
Copy link
Member

SuperQ commented Feb 20, 2025

Yes, as a boolean flag is better. Thanks.

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.

2 participants