Skip to content

Commit 883af29

Browse files
committed
chore: log monitoring properties
1 parent f0e01dc commit 883af29

File tree

3 files changed

+6
-29
lines changed

3 files changed

+6
-29
lines changed

aws_advanced_python_wrapper/utils/properties.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@
1313
# limitations under the License.
1414

1515
import copy
16+
import logging
1617
from typing import Any, Dict, Optional
1718
from urllib.parse import unquote
1819

1920
from aws_advanced_python_wrapper.errors import AwsWrapperError
2021
from aws_advanced_python_wrapper.utils.messages import Messages
2122

23+
logger = logging.getLogger(__name__)
24+
2225

2326
class Properties(Dict[str, Any]):
2427
def put_if_absent(self, key: str, value: Any):
@@ -621,4 +624,6 @@ def create_monitoring_properties(props: Properties) -> Properties:
621624
if property_key.startswith(PropertiesUtils._MONITORING_PROPERTY_PREFIX):
622625
monitoring_properties[property_key[len(PropertiesUtils._MONITORING_PROPERTY_PREFIX):]] = \
623626
monitoring_properties.pop(property_key)
627+
628+
logger.info(f"Monitoring properties created: {PropertiesUtils.mask_properties(monitoring_properties)}")
624629
return monitoring_properties

tests/integration/container/test_aurora_failover.py

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def aurora_utility(self):
6666
def props(self):
6767
p: Properties = Properties({
6868
"plugins": "failover",
69-
"socket_timeout": 30,
69+
"socket_timeout": 10,
7070
"connect_timeout": 10,
7171
"monitoring-connect_timeout": 5,
7272
"monitoring-socket_timeout": 5,
@@ -329,28 +329,3 @@ def test_writer_failover_in_idle_connections(
329329
# Ensure that all idle connections are closed.
330330
for idle_connection in idle_connections:
331331
assert idle_connection.is_closed is True
332-
333-
@enable_on_features([TestEnvironmentFeatures.NETWORK_OUTAGES_ENABLED])
334-
def test_failover__socket_timeout(
335-
self,
336-
test_driver: TestDriver,
337-
test_environment: TestEnvironment,
338-
proxied_props,
339-
conn_utils,
340-
aurora_utility):
341-
target_driver_connect = DriverHelper.get_connect_func(test_driver)
342-
reader: TestInstanceInfo = test_environment.get_proxy_instances()[1]
343-
writer_id: str = test_environment.get_proxy_writer().get_instance_id()
344-
345-
WrapperProperties.PLUGINS.set(proxied_props, "failover")
346-
WrapperProperties.SOCKET_TIMEOUT_SEC.set(proxied_props, 3)
347-
with AwsWrapperConnection.connect(
348-
target_driver_connect,
349-
**conn_utils.get_proxy_connect_params(reader.get_host()),
350-
**proxied_props) as aws_conn:
351-
ProxyHelper.disable_connectivity(reader.get_instance_id())
352-
aurora_utility.assert_first_query_throws(aws_conn, FailoverSuccessError)
353-
354-
current_connection_id = aurora_utility.query_instance_id(aws_conn)
355-
assert writer_id == current_connection_id
356-
assert aurora_utility.is_db_instance_writer(current_connection_id) is True

tests/integration/container/test_read_write_splitting.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,6 @@ def test_set_read_only_true__all_readers_down(
244244
target_driver_connect = DriverHelper.get_connect_func(test_driver)
245245
connect_params = conn_utils.get_proxy_connect_params()
246246

247-
# To prevent endless waiting while executing SQL queries
248-
WrapperProperties.SOCKET_TIMEOUT_SEC.set(connect_params, 10)
249-
250247
with AwsWrapperConnection.connect(target_driver_connect, **connect_params, **proxied_props) as conn:
251248
writer_id = rds_utils.query_instance_id(conn)
252249

0 commit comments

Comments
 (0)