Missing rules when using expirable maps/caches from popular open source libraries

未关闭
#37 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
aws, java
领域
devtools

调研方向

首先定位仓库中与 SnapStart 相关警告对应的 Java 规则定义和测试。检查各项检查如何识别库和方法的使用,然后覆盖 Guava expireAfterAccess/expireAfterWrite 以及 ExpiringMap 的过期变体。完成标准是相关的可过期缓存模式会产生警告,同时非过期缓存的使用不受影响。

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Java
星标
53
派生
10
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

aws/aws-lambda-snapstart-java-rules 的其他 Issue

查看 aws/aws-lambda-snapstart-java-rules 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。