Skip to content

Commit 4ba355a

Browse files
authored
Netty connector hang up after repeated buffer overflow errors when writing data #5753 (#5755)
Signed-off-by: Jorge Bescos Gascon <[email protected]>
1 parent 683d924 commit 4ba355a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/internal/JerseyChunkedInput.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2019 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2024 Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -208,10 +208,12 @@ private void write(Provider<ByteBuffer> bufferSupplier) throws IOException {
208208
try {
209209
boolean queued = queue.offer(bufferSupplier.get(), WRITE_TIMEOUT, TimeUnit.MILLISECONDS);
210210
if (!queued) {
211+
close();
211212
throw new IOException("Buffer overflow.");
212213
}
213214

214215
} catch (InterruptedException e) {
216+
close();
215217
throw new IOException(e);
216218
}
217219
}

0 commit comments

Comments
 (0)