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

[Backport 7.56.x] [mysql] revert default read_timeout #18098

Merged
merged 1 commit into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion mysql/assets/configuration/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,11 @@ files:
- name: read_timeout
description: |
The timeout for reading from the connection in seconds.
The default read timeout is 10 seconds.
By default, no read timeout is set.
value:
type: number
example: 10
display_default: null

- name: ssl
description: |
Expand Down
1 change: 1 addition & 0 deletions mysql/changelog.d/18097.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Revert the default 10s mysql connection read_timeout
2 changes: 1 addition & 1 deletion mysql/datadog_checks/mysql/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(self, instance):
self.additional_status = instance.get('additional_status', [])
self.additional_variable = instance.get('additional_variable', [])
self.connect_timeout = instance.get('connect_timeout', 10)
self.read_timeout = instance.get('read_timeout', 10)
self.read_timeout = instance.get('read_timeout', None)
self.max_custom_queries = instance.get('max_custom_queries', DEFAULT_MAX_CUSTOM_QUERIES)
self.charset = instance.get('charset')
self.dbm_enabled = is_affirmative(instance.get('dbm', instance.get('deep_database_monitoring', False)))
Expand Down
4 changes: 0 additions & 4 deletions mysql/datadog_checks/mysql/config_models/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,5 @@ def instance_port():
return 3306


def instance_read_timeout():
return 10


def instance_use_global_custom_queries():
return 'true'
4 changes: 2 additions & 2 deletions mysql/datadog_checks/mysql/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ instances:
#
# connect_timeout: 10

## @param read_timeout - number - optional - default: 10
## @param read_timeout - number - optional
## The timeout for reading from the connection in seconds.
## The default read timeout is 10 seconds.
## By default, no read timeout is set.
#
# read_timeout: 10

Expand Down
10 changes: 5 additions & 5 deletions mysql/tests/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_connection_with_defaults_file():
'autocommit': True,
'ssl': None,
'connect_timeout': 10,
'read_timeout': 10,
'read_timeout': None,
'read_default_file': '/foo/bar',
}
assert 'host' not in connection_args
Expand All @@ -45,7 +45,7 @@ def test_connection_with_sock():
'autocommit': True,
'ssl': None,
'connect_timeout': 10,
'read_timeout': 10,
'read_timeout': None,
'unix_socket': '/foo/bar',
'user': 'ddog',
'passwd': 'pwd',
Expand All @@ -65,7 +65,7 @@ def test_connection_with_host():
'autocommit': True,
'ssl': None,
'connect_timeout': 10,
'read_timeout': 10,
'read_timeout': None,
'user': 'ddog',
'passwd': 'pwd',
'host': 'localhost',
Expand All @@ -80,7 +80,7 @@ def test_connection_with_host_and_port():
'autocommit': True,
'ssl': None,
'connect_timeout': 10,
'read_timeout': 10,
'read_timeout': None,
'user': 'ddog',
'passwd': 'pwd',
'host': 'localhost',
Expand All @@ -102,6 +102,6 @@ def test_connection_with_charset(instance_basic):
'port': common.PORT,
'ssl': None,
'connect_timeout': 10,
'read_timeout': 10,
'read_timeout': None,
'charset': 'utf8mb4',
}
Loading