Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(aws): Enable stale key evictions for amazon load balancers #1994

Merged
merged 1 commit into from
Oct 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public void storeAgentResult(Agent agent, CacheResult result) {
Collection<String> evictionsForType = result.getEvictions().computeIfAbsent(type, evictableKeys -> new ArrayList<>());
evictionsForType.addAll(evictableIdentifiers);

log.info("Evicting stale identifiers: {}", evictableIdentifiers);
log.debug("Evicting stale identifiers: {}", evictableIdentifiers);
}
} catch (Exception e) {
log.error("Failed to check for stale identifiers (type: {}, pattern: {}, agent: {})", type, cacheKeyPatternForType, agent, e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ class AmazonApplicationLoadBalancerCachingAgent extends AbstractAmazonLoadBalanc
this.eddaTimeoutConfig = eddaTimeoutConfig
}

@Override
Optional<Map<String, String>> getCacheKeyPatterns() {
return [
(LOAD_BALANCERS.ns): Keys.getLoadBalancerKey('*', account.name, region, 'vpc-????????', '*')
]
}

@Override
OnDemandAgent.OnDemandResult handle(ProviderCache providerCache, Map<String, ? extends Object> data) {
if (!data.containsKey("loadBalancerName")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ class AmazonLoadBalancerCachingAgent extends AbstractAmazonLoadBalancerCachingAg
super(amazonCloudProvider, amazonClientProvider, account, region, objectMapper, registry)
}

@Override
Optional<Map<String, String>> getCacheKeyPatterns() {
return [
(LOAD_BALANCERS.ns): Keys.getLoadBalancerKey('*', account.name, region, 'vpc-????????', null)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

key structure differs depending on whether or not a load balancer type is present so need to fix the vpc length vs '*' globing.

classic load balancers do not include a type in their keys

]
}

@Override
OnDemandAgent.OnDemandResult handle(ProviderCache providerCache, Map<String, ? extends Object> data) {
if (!data.containsKey("loadBalancerName")) {
Expand Down