Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PublisherAsStream gets stuck if idle-timeout is reached #11371

Open
RealTYPICAL opened this issue Nov 22, 2024 · 0 comments
Open

PublisherAsStream gets stuck if idle-timeout is reached #11371

RealTYPICAL opened this issue Nov 22, 2024 · 0 comments
Assignees
Labels
type: bug Something isn't working

Comments

@RealTYPICAL
Copy link

Expected Behavior

If the read idle timeout is reached then it appears as though the PublisherAsStream class then returns -1 on its next read method. If this happens when the micronaut.server.idle-timeout is reached then I suppose it should do the same thing.

Actual Behaviour

The thread gets stuck at: /io/micronaut/http/netty/PublisherAsBlocking.java:160. The read idle timeout also doesn't seem to trigger in this circumstance.

Steps To Reproduce

private final HttpServerConfiguration configuration;

	@Inject
	public UploadController(HttpServerConfiguration configuration) {
		this.configuration = configuration;
	}

	@Post(consumes = MediaType.ALL)
	@ExecuteOn(TaskExecutors.IO)
	@RequestLengthLimit(RequestLengthLimit.NO_LIMIT)
	public final HttpResponse uploadBytes(@Body InputStream body) throws InterruptedException, IOException {
		Thread.sleep(configuration.getIdleTimeout().toMillis() + 1000); //set micronaut.server.idle-timeout to something low like 5s (default 5m)
		body.transferTo(OutputStream.nullOutputStream());
		System.out.println("Unreachable");
		return HttpResponse.noContent();
	}

I found that the above code reproduces the problem as long as I used a 90kb worth of data. For smaller data it seemed to work better.

Environment Information

Linux
Openjdk-23

Example Application

No response

Version

4.6.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

3 participants