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

Better protect against concurrent error handling for async requests #32342

Closed
github-actions bot opened this issue Feb 28, 2024 · 0 comments
Closed

Better protect against concurrent error handling for async requests #32342

github-actions bot opened this issue Feb 28, 2024 · 0 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: backport An issue that is a backport of another issue to a maintenance branch type: bug A general bug
Milestone

Comments

@github-actions
Copy link

Backport of gh-32340

@github-actions github-actions bot added in: web Issues in web modules (web, webmvc, webflux, websocket) type: backport An issue that is a backport of another issue to a maintenance branch type: bug A general bug labels Feb 28, 2024
@github-actions github-actions bot added this to the 5.3.33 milestone Feb 28, 2024
@rstoyanchev rstoyanchev self-assigned this Feb 28, 2024
rstoyanchev added a commit that referenced this issue Feb 29, 2024
In preparation for a larger update, start by aligning with
6.1.x, which includes changes for gh-32042 and gh-30232.

See gh-32342
rstoyanchev added a commit that referenced this issue Feb 29, 2024
1. Use state transitions
2. Increase synchronized scope in setConcurrentResultAndDispatch

See gh-32342
rstoyanchev added a commit that referenced this issue Mar 1, 2024
The wrapped response prevents use after AsyncListener onError or completion
to ensure compliance with Servlet Spec 2.3.3.4.

See gh-32342
rstoyanchev added a commit that referenced this issue Mar 1, 2024
rstoyanchev added a commit that referenced this issue Mar 1, 2024
The lock protects against race between onError/onComplete notifications
and operations on the ServletOutputStream.

See gh-32342
rstoyanchev added a commit that referenced this issue Mar 3, 2024
Dispatching was prevented for disconnected client errors after
recent reports like #32042 when running on Tomcat, and the
async request was completed from the onError notification.
This has the side effect of not allowing exception resolvers
to take final action even if the response is not writeable.

After all updates for this issue, it appears the dispatch no
longer causes issues. Tomcat actually does not do the dispatch,
but it doesn't seem to cause any issues, and on other servers
like Jetty where the dispatch works, applications can have a
chance to handle the exception.

This change removes the disconnected client checks and allows
dispatching again. After the change DisconnectedClientHelper
is no longer needed in the 5.3.x branch.

See gh-32342
rstoyanchev added a commit that referenced this issue Mar 3, 2024
Avoid the overhead of locking in the ServletOutputStream wrapper
if it is not an asynchronous request.

See gh-32342
rstoyanchev added a commit that referenced this issue Mar 5, 2024
This is a backport of commits 4b96cd and ef0717.

Closes gh-32342
rstoyanchev added a commit that referenced this issue Mar 7, 2024
webmvc.fn now also uses the StandardServletAsyncWebRequest wrapped response
to enforce lifecycle rules from Servlet spec (section 2.3.3.4).

See gh-32342
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: backport An issue that is a backport of another issue to a maintenance branch type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant