Skip to content

BufferClosedException when decoding to Flux in StringDecoder #29119

@rstoyanchev

Description

@rstoyanchev

Following the upgrade to Netty 5 in #28847, there is one remaining WebFlux test that fails.

The test case is a 500 error, suppressed with a status handler, so the response body is decoded as normal. However, it appears to not be related to the suppressed status. It can be reproduced with a normal response decoded to Flux<String>.

// WebClientIntegrationTests

@Test
void retrieveTextDecodedToFlux() {

	ReactorNetty2ClientHttpConnector connector = new ReactorNetty2ClientHttpConnector();
	startServer(connector);

	prepareResponse(response -> response
			.setHeader("Content-Type", "text/plain")
			.setBody("Hey now"));

	Flux<String> result = this.webClient.get()
			.uri("/")
			.accept(MediaType.TEXT_PLAIN)
			.retrieve()
			.bodyToFlux(String.class);

	StepVerifier.create(result)
			.expectNext("Hey now")
			.expectComplete()
			.verify(Duration.ofSeconds(3));
}

StringDecoder has a more advanced buffer manipulation when decoding for Flux. This is most likely related to the changes in #28874.

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions