You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@synapse.apache.org by xuhongbo <xu...@tongtech.com> on 2008/02/26 05:39:20 UTC

network break down doesn't immediately cause Client request failure

Recently , I found out that while synapse relaying the request from client to another axis server, if the network break down, client will never received failure immediatly. It always failed while it's own timeout exceed or synapse's internal timeout exceed;

scenarios:

Using http porotocol;
axisClient<-->synapse <--> axisServer

1) axisClient send request to synapse
2) syanpse relay request to axisServer
3) network between synapse and axisServer breakdown(or just shutdown axisServer)
4) axisClient doens't failure immediatly, It's alway's failure when it's timeout exceed;


The more details reson I have find out is:

When network breakdown(or axisServer shutdown),  org.apache.synapse.transport.nhttp.ClientHandler's corresponding callback handler is invoked (onClose(), or onException(),...) . and the callback only just shutdown the connection.

But the sessionRequestCallback(HttpCoreNIOSender.sessionRequestCallback) registed when establish http connection(ioreactor.connect(...)) will never be called. so the failure response will not be generated and send back to axisClient.

And is there any other things could I do to avoid this situation?



Re: network break down doesn't immediately cause Client request failure

Posted by "Asankha C. Perera" <as...@wso2.com>.
Hi
> When network breakdown(or axisServer shutdown),  org.apache.synapse.transport.nhttp.ClientHandler's corresponding callback handler is invoked (onClose(), or onException(),...) . and the callback only just shutdown the connection.
>
> But the sessionRequestCallback(HttpCoreNIOSender.sessionRequestCallback) registed when establish http connection(ioreactor.connect(...)) will never be called. so the failure response will not be generated and send back to axisClient.
>   
Can you raise an issue on the JIRA so one of us can take a proper look
and ensure that we detect network disconnections and timeouts correctly
> And is there any other things could I do to avoid this situation?
>   
You can use the timeout property for endpoints
(http://synapse.apache.org/Synapse_Configuration_Language.html#address-endpoint)
to overcome this
/" Address endpoints can timeout if responses fail to arrive at Synapse
by a predefined timeout-duration specified in seconds. The timeout
action specifies whether to discard responses that arrives late, or to
trigger a fault. Synapse has a periodic timeout handler that triggers
itself at each 15 second interval. Thus endpoint timeouts will have a
+/- error on actual trigger time. Though this can be minimized by
setting a System property "synapse.timeout_handler_interval" to a
millisecond duration below the desired endpoint timeout, care must be
taken as a lesser value may have a higher overhead on the system."/


asankha