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

Connection prematurely closed DURING response #2944

Open
Aliaksie opened this issue Oct 27, 2023 · 4 comments
Open

Connection prematurely closed DURING response #2944

Aliaksie opened this issue Oct 27, 2023 · 4 comments
Labels
type/bug A general bug
Milestone

Comments

@Aliaksie
Copy link

Aliaksie commented Oct 27, 2023

Possible similar to link or link

-> client send large multipart RQ
-> server receive
-> check size and throw 413
-> we catch it in our error handler and return 413 with json RS
-> server send completed
-> server on TERMINATED check if it consume full RQ
-> send new IOException("unconsumed input") and close connection

-> if the client has not yet completed processing, then it will receive an error and crash, otherwise it can complete the request smoothly (for example turn on DEBUG logs for jetty server).

Expected Behavior

the client will complete without error. I got 413 with json body.

Actual Behavior

the client does not complete consistently. I often get an error:

reactor.netty.http.client.PrematureCloseException: Connection prematurely closed DURING response
reactor.core.Exceptions$ReactiveException: reactor.netty.http.client.PrematureCloseException: Connection prematurely closed DURING response

Steps to Reproduce

check the demo-repo

Possible Solution

add .header( "Connection", "close" ) for file upload than here _generator.isPersistent() will always false

Your Environment

  • org.springframework.boot -> 3.1.5
  • jetty.version -> 11.0.16
  • reactor-netty -> 1.1.11
  • spring-boot-starter-jetty -> 3.1.4
@Aliaksie Aliaksie added status/need-triage A new issue that still need to be evaluated as a whole type/bug A general bug labels Oct 27, 2023
@violetagg violetagg self-assigned this Oct 30, 2023
@violetagg violetagg removed the status/need-triage A new issue that still need to be evaluated as a whole label Oct 30, 2023
@violetagg
Copy link
Member

@Aliaksie I'm gonna work on this one.

@hakusai22
Copy link

hakusai22 commented Jan 5, 2024

.retry(1)

@weiyouren
Copy link

I also have the same problem

@violetagg violetagg removed their assignment Jan 29, 2024
@violetagg violetagg added this to the 1.2.x Backlog milestone Jan 29, 2024
@yvzhu0407
Copy link

@weiyouren how do you fix this error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug A general bug
Projects
None yet
Development

No branches or pull requests

5 participants