-
Notifications
You must be signed in to change notification settings - Fork 15
Description
Describe the bug
The SlidingExpirationCacheWithCleanupThread as used in the custom_endpoint_plugin.py, specifically here:
aws-advanced-python-wrapper/aws_advanced_python_wrapper/custom_endpoint_plugin.py
Line 230 in 74ae5de
| _monitors: ClassVar[SlidingExpirationCacheWithCleanupThread[str, CustomEndpointMonitor]] = \ |
causes long delays during process shutdown as it essentially behaves like a global variable. It would be best to do explicit lifecycle handling of this object.
Expected Behavior
No severe delays/issues just from importing the aws-advanced-connection-wrapper.
What plugins are used? What other connection properties were set?
rds, iam
Current Behavior
The library caused severe delays when shutting down the service.
Reproduction Steps
Load the library without actually using it in any code, then wait for the process to terminate.
Possible Solution
Add explicit lifetime handling of the thread, ensure it isn't instantiated at load time but is tied to the lifecycle of the connection wrapper object.
Additional Information/Context
No response
The AWS Advanced Python Wrapper version used
1.4.0
python version used
3.13
Operating System and version
Ubuntu Linux 25.04