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

Review callers of HttpChannelState.onIdleTimeout() #11320

Open
sbordet opened this issue Jan 25, 2024 · 1 comment
Open

Review callers of HttpChannelState.onIdleTimeout() #11320

sbordet opened this issue Jan 25, 2024 · 1 comment
Assignees
Labels
Bug For general bugs on Jetty side

Comments

@sbordet
Copy link
Contributor

sbordet commented Jan 25, 2024

Jetty version(s)
12+

Description
The callers of HttpChannelState.onIdleTimeout() look for 2 data: a Runnable and a boolean.

For example in HttpConnection:

        if (_httpChannel.getRequest() == null)
            return true;
        Runnable task = _httpChannel.onIdleTimeout(timeout);
        ...

This is slightly racy, and HttpChannelState grabs a lock to check the internal state, so it could do the check on the existence of the request within the lock.

Also, there are difference between HTTP/1.1 and HTTP/2: in H1 there is just a check on the request, but in H2 there is a call to isRequestHandled() which may be equivalent, but the logic should be the same.

This issue is about 2 things:

  1. Normalizing the logic across all HTTP versions
  2. See if possible to return a null task to indicate to the caller to return true, so that we are not forced to make 2 calls to gather the task and the boolean.
@gregw
Copy link
Contributor

gregw commented Oct 2, 2024

Also see #12301

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side
Projects
Status: 🏗 In progress
Development

No branches or pull requests

2 participants