Skip to content
This repository has been archived by the owner on Jun 26, 2024. It is now read-only.

Commit

Permalink
Netty OOM fix (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
laxmanchekka authored Aug 20, 2021
1 parent c3fd8bd commit 040b336
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,22 @@ public AttributeMetadata load(
.addScopeString(scopeAndKeyPairBasedCacheKey.getDataKey().getKey())
.build());

AttributeMetadata result = null;
while (attributeMetadataIterator.hasNext()) {
AttributeMetadata metadata = attributeMetadataIterator.next();
// metadata already found
if (result != null) {
continue;
}
// DON'T short-circuit the iterator.
// Continue to iterate fully to avoid netty leak
if (metadata
.getKey()
.equals(scopeAndKeyPairBasedCacheKey.getDataKey().getValue())) {
return metadata;
result = metadata;
}
}
return null;
return result;
}
};

Expand Down
4 changes: 2 additions & 2 deletions gateway-service/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ dependencies {
implementation("com.typesafe:config:1.4.1")

constraints {
runtimeOnly("io.netty:netty-codec-http2:4.1.61.Final") {
runtimeOnly("io.netty:netty-codec-http2:4.1.63.Final") {
because("https://snyk.io/vuln/SNYK-JAVA-IONETTY-1083991")
}
runtimeOnly("io.netty:netty-handler-proxy:4.1.61.Final") {
runtimeOnly("io.netty:netty-handler-proxy:4.1.63.Final") {
because("https://snyk.io/vuln/SNYK-JAVA-IONETTY-1083991")
}
}
Expand Down

0 comments on commit 040b336

Please sign in to comment.