aws / aws/aws-lambda-snapstart-java-rules

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

Đang mở
#37 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Java
Star
53
Fork
10
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.