Skip to content

False timeouts when using StreamedAsyncHandler #1721

Closed
@n-miles

Description

@n-miles

When using the StreamedAsyncHandler to download large files, I found what I think is a bug in how timeouts are handled.

The timeout mechanism relies on when the ListenableFuture for the request was last touch()ed. touch() is only called when a HttpResponseBodyPart is delivered to the downstream. This works fine if the downstream is downloading the response as fast as possible.

However, if the downstream has no outstanding request() (like if it's serving as a proxy and its own downstream is slow or whatever), there may be long periods of time where there are no body parts published because none have been requested. In those periods, the request may "time out" because of inactivity.

I think we should change the timeout logic to only count this as a timeout if there has been no activity AND there is no outstanding request on the Publisher. This can be implemented by periodically touch()ing the ListenableFuture if there is no outstanding request() on the Publisher.

I am willing to implement it if we want this feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions