You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when accessing values from the `DataLoader`'s `CacheMap`, we
first check `#containsKey` before invoking `#get`. This is problematic
for two reasons:
- the underlying cache's metrics are skewed (it will have a 100% hit
rate).
- if the cache has an automatic expiration policy, it is possible a
value will expire between the `containsKey` and `get` invocations
leading to an incorrect result.
To ameliorate this, we always invoke `#get` and check if it is `null` to
deterine whether the key is present. We wrap the invocation in a
`try`/`catch` as the `#get` method is allowed to through per its
documentation.
0 commit comments