-
Notifications
You must be signed in to change notification settings - Fork 401
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
Bug: parameters.get_parameters(.., max_age=24*60*60, force_fetch=True) does not work as expected anymore #5482
Comments
Thanks for opening your first issue here! We'll come back to you as soon as we can. |
Hey @NastHoloviz, thanks for reporting this! I'm taking a look in this issue right now. |
Hi @NastHoloviz! Again, thanks a lot for reporting this, yes I can confirm this is a bug when using |
Python shines brightly when it’s at its best, but it can be a real headache when it’s not. In the get_multiple function the order of parameter |
|
This is now released under 3.3.0 version! |
Thanks for taking care of this! |
Expected Behaviour
There was the issue found that when you grab data with
force_fetch=True
from the code you still get old value from the cache instead.You can find the example of the code of AWS Lambda lambda function in the code snippet as well, but I will explain here the details.
So here are some steps:
parameters.get_parameters(.., max_age=24*60*60, force_fetch=False)
- this will either get parameters data from API and put them into the cache or get parameters from cache if lambda was triggered before already (lambda function env memory).parameters.get_parameters(.., max_age=24*60*60, force_fetch=True)
within same code of same lambda function and see that value for updated parameter is still the old one. So that means thatforce_fetch
actually either did not get updated value from the API or did not update the cache.In the context of one lambda function execution it might be useless, but if we get params in lambda and put them to the cache, in couple minutes update some of the parameters and then trigger lambda function again with
force_fetch=True
- this lambda function still keeps old value in the memory. This is the issue.So expected behavior is that with
force_fetch=True
we will always get values updated from SSM.Current Behaviour
parameters.get_parameters(.., max_age=24*60*60, force_fetch=False)
- this will either get parameters data from API and put them into the cache or get parameters from cache if lambda was triggered before already (lambda function env memory).parameters.get_parameters(.., max_age=24*60*60, force_fetch=True)
within same code of same lambda function and see that value for updated parameter is still the old one. So that means thatforce_fetch
actually either did not get updated value from the API or did not update the cache.Code snippet
Possible Solution
No response
Steps to Reproduce
Please see Code snippet and Expected Behaviour sections.
Powertools for AWS Lambda (Python) version
latest
AWS Lambda function runtime
3.9
Packaging format used
PyPi
Debugging logs
Please see logs in attached screenshot.
The text was updated successfully, but these errors were encountered: