Missing rules when using expirable maps/caches from popular open source libraries
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start by locating the repository's Java rule definitions and tests for SnapStart-related warnings. Review how checks identify library and method usage, then cover Guava expireAfterAccess/expireAfterWrite and ExpiringMap expiration variants. Done means the relevant expirable-cache patterns produce a warning while non-expiring cache usage remains unaffected.
Written by the indexing model from the issue text.
Description
In case the expirable cache is initialized in the constructor of the Lambda class and some entries are put as well it may happen that the entries are not there anymore after the SnapStart snapshot is restored. The should be a warning of usage of time-based cached with the SnapStart is enabled.
In particular I'm thinking of the usage of 2 popular open source libraries:
- Google Guava ( artifact id guava and group id com.google.guava) and the code like this
myCache = CacheBuilder.newBuilder().expireAfterAccess(3600, TimeUnit.SECONDS) .build();
myCache.put("key", "value");
- Using artifact id expiringmap and the group id net.jodah and the code like this
expiredMap = ExpiringMap.builder().expiration(3600, TimeUnit.SECONDS).build();
expiredMap.put("key", "value");
I know that it's difficult to spot such use cases because both open source libraries offer standard and not expirable caches. But the invocation of the methods like CacheBuilder.newBuilder().expireAfterAccess/expireAfterWrite or multiple variations of methods ExpiringMap.builder().expiration* when creating the cache using these open source tools is a clear indication of the creation of expirable cache.
- Dominant language
- Java
- Stars
- 53
- Forks
- 10
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from aws/aws-lambda-snapstart-java-rules
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
aws/aws-lambda-snapstart-java-rules#35 · 1 comment ·
All issues in aws/aws-lambda-snapstart-java-rules
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100