Added a defer_refresh parameter to AutoRefreshableSession! #3
Closed
michaelthomasletts
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Someone recently asked me in a thread on Reddit about the difference between the
RefreshableCredentialsandDeferredRefreshableCredentialsobjects inbotocore. That question got me thinking that I should finally add adefer_refreshoption toAutoRefreshableSessionso that users can choose between lazy and active temporary credential refreshes, which is something I planned on doing eventually but had not prioritized yet.For context, the
DeferredRefreshableCredentialsobject does not refresh temporary credentials until those credentials are explicitly needed; however, theRefreshableCredentialsobject refreshes temporary credentials the moment that they expire. The former is lazy; the latter is active. It is possible that the latter might be inefficient in some systems, hence my decision to finally includedefer_refreshas a parameter.Please note that, according to one user,
DeferredRefreshableCredentialsis leaking memory. I have not tested that claim myself; however, it may, according to their analysis, be something to be mindful of. You may, therefore, want to usedefer_refresh=Falsein the meantime until that issue is resolved. I will monitor the issue and update the version ofboto3inpyproject.tomlaccordingly.This discussion was created from the release Added a defer_refresh parameter to AutoRefreshableSession!.
Beta Was this translation helpful? Give feedback.
All reactions