Added a defer_refresh parameter to AutoRefreshableSession! #3
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
-
Someone recently asked me in a thread on Reddit about the difference between the
RefreshableCredentials
andDeferredRefreshableCredentials
objects inbotocore
. That question got me thinking that I should finally add adefer_refresh
option toAutoRefreshableSession
so 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
DeferredRefreshableCredentials
object does not refresh temporary credentials until those credentials are explicitly needed; however, theRefreshableCredentials
object 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_refresh
as a parameter.Please note that, according to one user,
DeferredRefreshableCredentials
is 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=False
in the meantime until that issue is resolved. I will monitor the issue and update the version ofboto3
inpyproject.toml
accordingly.This discussion was created from the release Added a defer_refresh parameter to AutoRefreshableSession!.
Beta Was this translation helpful? Give feedback.
All reactions