-
Notifications
You must be signed in to change notification settings - Fork 3k
Discard remaining REST handlers when the client connection is closed prematurely #50990
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
Conversation
…prematurely Relates to: quarkusio#50958
This comment has been minimized.
This comment has been minimized.
Status for workflow
|
|
Meh. I don't think there's any expectation that response handlers run when the connection is closed. In fact I doubt this is even defined or specified. There could be people asking for callbacks to be run after the connection closes, for cleanup. Like, making sure the TX is rolled back (but this happens in interceptors, so that should not be interrupted and complete, even with this change, which only skips the remaining steps, it does not interrupt any running one), or closing connections to the DB perhaps? I'm not entirely sure what sort of handlers we have after the endpoint, and whether we can afford to skip them on connection loss. Do you have any sample? |
| try { | ||
| context.discardRemaining(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heh, I was going to say exactly the same thing. I'm impressed.
I'm not sure what thread invokes the close handler (I guess/hope the same request's context/thread) and what other thread might be running the request (especially in the case of blocking requests).
So this might indeed have more than one thread interact with the handler position in parallel. Needs to be checked.
Agreed
Sure, but those are not REST handlers and would likely be handled in a different way
Most prominent are |
|
Yeah, those should be fine. |
P.S. This is a breaking change because there might be code out there that depends on the side effects of various handlers always running (like code in response filters)