Skip to content

Commit

Permalink
Upgrade to Netty 4.1.76 (elastic#86252)
Browse files Browse the repository at this point in the history
Staying up to date. This upgrade comes with two non-trivial
change. The thread local cache buffer cache has been disabled
for non-transport threads and the default pooled buffer chunk
size has been reduced to 4M from 16M.
The later change I think is without any effect for us since we
allocate buffers in 16k chunks on our end when doing outbound
writes and if anything should save us memory.
The disabling of thread-local buffer cache could have some effect
but is hardly measurable in practice. That combined with the fact
that we can switch back to the old behavior via the Netty system
property made me go with the new behavior here which does save us
some heap memory at hardly measurable CPU cost.
  • Loading branch information
original-brownbear authored Apr 29, 2022
1 parent 943c0d5 commit 46db6a5
Show file tree
Hide file tree
Showing 45 changed files with 32 additions and 26 deletions.
2 changes: 1 addition & 1 deletion build-tools-internal/version.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ecsLogging = 1.2.0

jna = 5.10.0

netty = 4.1.74.Final
netty = 4.1.76.Final

commons_lang3 = 3.9

Expand Down
5 changes: 5 additions & 0 deletions docs/changelog/86252.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 86252
summary: Upgrade to Netty 4.1.76
area: Network
type: upgrade
issues: []
2 changes: 1 addition & 1 deletion modules/repository-azure/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ tasks.named("thirdPartyAudit").configure {
'com.aayushatharva.brotli4j.Brotli4jLoader',
'com.aayushatharva.brotli4j.decoder.DecoderJNI$Status',
'com.aayushatharva.brotli4j.decoder.DecoderJNI$Wrapper',
'com.aayushatharva.brotli4j.encoder.Encoder',
'com.aayushatharva.brotli4j.encoder.Encoders',
'com.aayushatharva.brotli4j.encoder.Encoder$Mode',
'com.aayushatharva.brotli4j.encoder.Encoder$Parameters',

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
231f5042a5050773eb22a918e84daff3f00892f2

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
042b95ef41b928284842acf36a22547ba8a09fe5

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3088a5864aeb80329230efae94f6415355a38d26

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
27cd81587a536cd4fed0a4d91466f8c2f4ffd405

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
199f8352c0f19e5be97a0eac6a0b65d8f7da4218

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
df4ecdf43c91e82eff39b59aefd203f548a9e7d8

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
38d0b500f098dc89497b6e608d7427186f533cf0

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
36a48583fa7da27be829b843d7eee9a8d89428e3

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
76f86e4215726a3407f8556836516585f2b59e62

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
e0b225a33772cb7bba73dc296cccefa6826ab8cc

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0a256dcc4482a771db0824ab74bddd41069a300e

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
f01d2f935005b6fdb2fedc23114d2ae717749c36

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d5ed8c4be9680203c53f7ed788225c12c4d87ee0
3 changes: 2 additions & 1 deletion modules/transport-netty4/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ tasks.named("thirdPartyAudit").configure {
'com.aayushatharva.brotli4j.Brotli4jLoader',
'com.aayushatharva.brotli4j.decoder.DecoderJNI$Status',
'com.aayushatharva.brotli4j.decoder.DecoderJNI$Wrapper',
'com.aayushatharva.brotli4j.encoder.Encoder',
'com.aayushatharva.brotli4j.encoder.Encoders',
'com.aayushatharva.brotli4j.encoder.Encoder$Mode',
'com.aayushatharva.brotli4j.encoder.Encoder$Parameters',

Expand All @@ -112,6 +112,7 @@ tasks.named("thirdPartyAudit").configure {
'io.netty.internal.tcnative.Buffer',
'io.netty.internal.tcnative.CertificateCompressionAlgo',
'io.netty.internal.tcnative.Library',
'io.netty.internal.tcnative.SessionTicketKey',
'io.netty.internal.tcnative.SSL',
'io.netty.internal.tcnative.SSLContext',
'io.netty.internal.tcnative.SSLPrivateKeyMethod',
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
231f5042a5050773eb22a918e84daff3f00892f2

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
042b95ef41b928284842acf36a22547ba8a09fe5

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
27cd81587a536cd4fed0a4d91466f8c2f4ffd405

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
38d0b500f098dc89497b6e608d7427186f533cf0

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
36a48583fa7da27be829b843d7eee9a8d89428e3

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
e0b225a33772cb7bba73dc296cccefa6826ab8cc

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
f01d2f935005b6fdb2fedc23114d2ae717749c36
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.elasticsearch.test.rest.ObjectPath;

import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.Map;

import static org.elasticsearch.rest.RestStatus.BAD_REQUEST;
Expand Down Expand Up @@ -56,13 +56,13 @@ public void testBadRequest() throws IOException {
maxMaxInitialLineLength = Math.max(maxMaxInitialLineLength, maxIntialLineLength);
}

final String path = "/" + new String(new byte[maxMaxInitialLineLength], Charset.forName("UTF-8")).replace('\0', 'a');
final String path = "/" + new String(new byte[maxMaxInitialLineLength], StandardCharsets.UTF_8).replace('\0', 'a');
final ResponseException e = expectThrows(
ResponseException.class,
() -> client().performRequest(new Request(randomFrom("GET", "POST", "PUT"), path))
);
assertThat(e.getResponse().getStatusLine().getStatusCode(), equalTo(BAD_REQUEST.getStatus()));
assertThat(e, hasToString(containsString("too_long_frame_exception")));
assertThat(e, hasToString(containsString("too_long_http_line_exception")));
assertThat(e, hasToString(matches("An HTTP line is larger than \\d+ bytes")));
}

Expand Down

0 comments on commit 46db6a5

Please sign in to comment.