Skip to content

Update Javadoc on async request timeout value in HandlerFunctionAdapter #29882

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

Closed
wants to merge 4 commits into from

Conversation

srivatsa-cfp
Copy link
Contributor

  • Validate the timeout value passed to setAsyncRequestTimeout is positive value.
  • Avoid setting negative value. If negative value is passed then set it to default timeout.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
- Validate the timeout value passed to setAsyncRequestTimeout is positive value.
- Avoid setting negative value. If negative value is passed then set it to default timeout.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
…eout

fix(src) : check if the timeout value is passed is positive value
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jan 25, 2023
@rstoyanchev rstoyanchev added the in: web Issues in web modules (web, webmvc, webflux, websocket) label Jan 27, 2023
@rstoyanchev rstoyanchev changed the title fix(src): check if the asyncRequestTimeout value is always positive Validate async request timeout value in HandlerFunctionAdapter Jan 27, 2023
@rstoyanchev
Copy link
Contributor

The spec says the value should be 0 (never time out) or greater:

Sets the time out for the asynchronous processing in milliseconds. A call to this method overrides the time out set by the container. If the time out is not specified via the call to setTimeout, 30000 is used as the default. A value of 0 or less indicates that the asynchronous operation will never time out. The time out applies to the AsyncContext once the container-initiated dispatch, during which one of the ServletRequest.startAsync methods was called, has returned to the container. It is illegal to call this method after the container-initiated dispatch on which the asynchronous cycle was started has returned to the container and will result in an IllegalStateException.

From a quick look, it does seem like the Servlet containers ignore a negative value. From that perspective, the proposed change doesn't change anything, but a Javadoc update could be useful.

@srivatsa-cfp
Copy link
Contributor Author

The spec says the value should be 0 (never time out) or greater:

Sets the time out for the asynchronous processing in milliseconds. A call to this method overrides the time out set by the container. If the time out is not specified via the call to setTimeout, 30000 is used as the default. A value of 0 or less indicates that the asynchronous operation will never time out. The time out applies to the AsyncContext once the container-initiated dispatch, during which one of the ServletRequest.startAsync methods was called, has returned to the container. It is illegal to call this method after the container-initiated dispatch on which the asynchronous cycle was started has returned to the container and will result in an IllegalStateException.

From a quick look, it does seem like the Servlet containers ignore a negative value. From that perspective, the proposed change doesn't change anything, but a Javadoc update could be useful.

Thanks for sharing the information. Do you want to route the proposal to updating the Javadoc?

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
- Update the Javadoc -  the setting 0 or negative value is indicates that the asynchronous operation will never time out.
- Helps the developer and maintainer to better understand the implementation.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
chore(doc): update the javadoc for setAsyncRequestTimeout
@srivatsa-cfp
Copy link
Contributor Author

Updated the JavaDoc

  • Update the Javadoc - the setting 0 or negative value is indicates that the asynchronous operation will never time out.
  • Helps the developer and maintainer to better understand the implementation.

@poutsma poutsma self-assigned this Jan 30, 2023
@poutsma poutsma added the type: documentation A documentation task label Jan 30, 2023
@poutsma poutsma added this to the 6.0.5 milestone Jan 30, 2023
@poutsma poutsma closed this in 9819cb3 Jan 30, 2023
@poutsma poutsma removed the status: waiting-for-triage An issue we've not yet triaged or decided on label Jan 30, 2023
@rstoyanchev rstoyanchev changed the title Validate async request timeout value in HandlerFunctionAdapter Update Javadoc on async request timeout value in HandlerFunctionAdapter Jan 30, 2023
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: documentation A documentation task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants