hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stepan Koltsov (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HTTPCLIENT-1074) Query timeout parameter
Date Sat, 26 Mar 2011 20:15:05 GMT
Query timeout parameter
-----------------------

                 Key: HTTPCLIENT-1074
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1074
             Project: HttpComponents HttpClient
          Issue Type: New Feature
    Affects Versions: 4.0.3
            Reporter: Stepan Koltsov
            Priority: Minor


HttpClient has connect timeout and read timeout. I also need a "query timeout" parameter.

Have a situation:

We are some server "B". Client "A" calls us with timeout 10s. To serve requests we call some
internal HTTP service "C":

A -> B -> C

HttpClient is used to call C from B.

Our call to that service "C" should be completed within 9s or should be interrupted, because:

* client "A" should get meaningful error message instead of just socket timeout
* we should not consume server resources (threads, connection) after client "A" stopped a
request

This behavior cannot be implemented with just connect timeout + socket timeout. For example,
if socket timeout is 5 seconds, and client sends 1 byte portions, socket timeout won't happen
for a long time.

So I'm requesting "query timeout" parameter. It's value is a system time (milliseconds since
epoch). HttpClient should execute request with respect to connect timeout and socket timeout
as usual, but if "query timeout" time has come, HttpClient throws an exception.

AFAIU, this behavior can be now achieved by using a extra thread and abort() method.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message