-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Fix #10229 EE10 Idle Timeout #10233
Fix #10229 EE10 Idle Timeout #10233
Conversation
Added test to reproduce
Fixed NPE if no failure listener
@sbordet I think the issue here is that we created the |
Ah we do add a listener : |
hmmmm ServletRequestState: public boolean onIdleTimeout(TimeoutException timeout)
{
try (AutoLock ignored = lock())
{
if (LOG.isDebugEnabled())
LOG.debug("onIdleTimeout {}", getStatusStringLocked(), timeout);
// TODO this is almost always returning false?!? what about read/write timeouts???
// return _state == State.IDLE;
return true;
}
} yeah we didn't finish this! If I implement the TODO, the test passes! |
Possible fix
Added test that idle works between requests
EE9 idle timeout
idle if read operation
Handle idleTimeout for IO operations differently
improve comments
Runnable invokeOnContentAvailable = _onContentAvailable; | ||
_onContentAvailable = null; | ||
|
||
// If a write call is in progress, take the writeCallback to fail below | ||
Runnable invokeWriteFailure = _response.lockedFailWrite(t); | ||
|
||
// If an IO operation was in progress | ||
if (invokeOnContentAvailable != null || invokeWriteFailure != null) | ||
{ | ||
// Then we will just fail the current operation and all future IO operation. | ||
// No listeners are called at all, as the application is already notified | ||
// TODO should we make this read failure transient, so it can be ignored by the application? | ||
if (_failure == null) | ||
{ | ||
_failure = Content.Chunk.from(t); | ||
} | ||
else if (ExceptionUtil.areNotAssociated(_failure.getFailure(), t) && _failure.getFailure().getClass() != t.getClass()) | ||
{ | ||
_failure.getFailure().addSuppressed(t); | ||
} | ||
|
||
return _serializedInvoker.offer(invokeOnContentAvailable, invokeWriteFailure); |
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.
Much of this was copied over from onFailure, so if there is an IO operation in progress, we just fail them when an idle timeout occurs.
I think this needs careful review
fixed test to not expect timeout listener to be called if there is demand
Idle timeouts for IO operations are not last.
Disable transient idle timeouts since AsyncContentProducer cannot handle them.
revert test to persistent idle failures
Fix #10229