Skip to content

Review callers of HttpChannelState.onIdleTimeout() #11320

@sbordet

Description

@sbordet

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.

Metadata

Metadata

Assignees

Labels

BugFor general bugs on Jetty side

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions