Skip to content

Commit

Permalink
There should be no exception indicating problems with ByteBuf#release
Browse files Browse the repository at this point in the history
  • Loading branch information
violetagg committed May 16, 2024
1 parent e4badf2 commit e22fc47
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,7 @@ private void doTestIssue825_2(BiFunction<ByteBuf, HttpServerResponse, Publisher<
int port2 = SocketUtils.findAvailableTcpPort();

AtomicReference<Throwable> error = new AtomicReference<>();
AtomicReference<Throwable> bufferReleasedError = new AtomicReference<>();
DisposableServer server1 = null;
DisposableServer server2 = null;
Sinks.Empty<Void> bufferReleased = Sinks.empty();
Expand Down Expand Up @@ -601,6 +602,7 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) {
.uri("/")
.responseContent()
.retain()
.doOnError(bufferReleasedError::set)
.flatMap(b -> serverFn.apply(b, out))
.doOnError(error::set))
.bindNow();
Expand All @@ -626,6 +628,7 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) {

assertThat(error.get()).isNotNull()
.isInstanceOf(RuntimeException.class);
assertThat(bufferReleasedError.get()).isNull();
}
finally {
if (server1 != null) {
Expand Down

0 comments on commit e22fc47

Please sign in to comment.