Skip to content

Conversation

@asureshraja
Copy link

@asureshraja asureshraja commented Jan 25, 2022

added try catch in computeifpresent to preserve old value incase of errors
Issue 5438 - #5438

}
return function.apply(k, oldValue);
}catch (Throwable e){
this.put(k,oldValue);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit sketchy, e.g. ConcurrentHashMap does not allow writes within a computation. I think it would be better to handle this within the compute method, even if a more complex method to understand.

@ben-manes
Copy link
Contributor

Ideally fix the formatting to Google's style guide, but maybe if merged that person will do it.

You might want to run Caffeine's test suite against your new dependency. You can use jitpack.io or a file dependency, and update the non-atomic computes from GuavaCacheFromContext. It runs many tests to 1-2hrs if the full suite.

@netdpb netdpb added P3 no SLO package=cache type=defect Bug, not working as expected labels Jan 28, 2022
@cpovirk
Copy link
Member

cpovirk commented Sep 26, 2025

We ended up going a different direction in #7980.

@cpovirk cpovirk closed this Sep 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 no SLO package=cache type=defect Bug, not working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants