You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Freeman Fang (JIRA)" <ji...@apache.org> on 2017/01/17 04:32:26 UTC

[jira] [Commented] (CXF-7211) receiveTimeouts aren't respected anymore since 3.1.9 for requests < 1000ms duration

    [ https://issues.apache.org/jira/browse/CXF-7211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15824954#comment-15824954 ] 

Freeman Fang commented on CXF-7211:
-----------------------------------

Hi Veit,

This is a good testcase and I get your point.
This is default expected behavior from org.apache.http.impl.nio.reactor.BaseIOReactor
{code}
    public BaseIOReactor(
            final long selectTimeout, final boolean interestOpsQueueing) throws IOReactorException {
        super(selectTimeout, interestOpsQueueing);
        this.bufferingSessions = new HashSet<IOSession>();
        this.timeoutCheckInterval = selectTimeout;
        this.lastTimeoutCheck = System.currentTimeMillis();
    }
{code}
The timeoutCheckInterval = selectTimeout = 1000ms by default, so that if your request take time less than 1000ms then the timeoutCheck won't be triggered as not meet the timeoutCheckInterval yet.

Fortunately in CXF we can configure this value at bus level, so for your test case if you add 
{code}
                        Bus bus = BusFactory.getDefaultBus();
		        bus.setProperty("org.apache.cxf.transport.http.async.selectInterval", 100);
{code}
in MyClientTest.java the test will pass.
NOTE, the default 1000ms is reasonable and make the value too small will cause performance concern and you need trade off this yourself.

Freeman

> receiveTimeouts aren't respected anymore since 3.1.9 for requests < 1000ms duration
> -----------------------------------------------------------------------------------
>
>                 Key: CXF-7211
>                 URL: https://issues.apache.org/jira/browse/CXF-7211
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 3.1.9
>            Reporter: Veit Guna
>            Assignee: Freeman Fang
>            Priority: Minor
>         Attachments: test.zip
>
>
> Starting with 3.1.9 receiveTimeouts aren't respected anymore for requests that take less than 1000ms using the async http conduit.
> See for details: http://cxf.547215.n5.nabble.com/receiveTimeout-ignored-since-3-1-9-tt5776188.html
> Please find attached a test project that demonstrates the issue.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)