Invocation Timeouts
2 min read
2 min read
2 min read
2 min read
2 min read
2 min read
2 min read
2 min read
2 min read
An invocation timeout limits how long Ice waits for an invocation to complete. When the timeout expires, the invocation fails with InvocationTimeoutException.
Ice starts the timer once it has marshaled the request parameters, before it obtains a connection, cached or newly established. For a twoway invocation, it stops the timer when it receives the reply, before it unmarshals the reply. For a oneway invocation, it stops the timer once it has sent the request. The timeout applies to the invocation as a whole, retries included.
Configuring Invocation Timeouts
Ice.Default.InvocationTimeout sets the default invocation timeout of proxies, in milliseconds. Its default value, -1, means no timeout. Ice does not marshal the invocation timeout with a proxy: a proxy unmarshaled from a request or a reply gets the default invocation timeout of the receiving communicator.
The InvocationTimeout proxy property sets the timeout of the proxy that propertyToProxy creates:
Greeter.Proxy=greeter:tcp -h localhost -p 4061Greeter.Proxy.InvocationTimeout=2500The ice_invocationTimeout proxy factory method returns a new proxy with the given timeout:
VisitorCenter::GreeterPrx greeter{communicator, "greeter:tcp -h localhost -p 4061"};greeter = greeter.ice_invocationTimeout(2500ms);var greeter = GreeterPrxHelper.createProxy( communicator, "greeter:tcp -h localhost -p 4061");greeter = GreeterPrxHelper.uncheckedCast( greeter.ice_invocationTimeout(TimeSpan.FromMilliseconds(2500)));var greeter = GreeterPrx.createProxy(communicator, "greeter:tcp -h localhost -p 4061");greeter = greeter.ice_invocationTimeout(Duration.ofMillis(2500));var greeter = new VisitorCenter.GreeterPrx( communicator, "greeter:tcp -h localhost -p 4061");greeter = greeter.ice_invocationTimeout(2500);greeter = GreeterPrx(communicator, 'greeter:tcp -h localhost -p 4061');greeter = greeter.ice_invocationTimeout(2500);$greeter = GreeterPrxHelper::createProxy( $communicator, 'greeter:tcp -h localhost -p 4061');$greeter = $greeter->ice_invocationTimeout(2500);greeter = GreeterPrx(communicator, "greeter:tcp -h localhost -p 4061")greeter = greeter.ice_invocationTimeout(2500)greeter = GreeterPrx.new(communicator, "greeter:tcp -h localhost -p 4061")greeter = greeter.ice_invocationTimeout(2500)var greeter = try makeProxy( communicator: communicator, proxyString: "greeter:tcp -h localhost -p 4061", type: GreeterPrx.self)greeter = greeter.ice_invocationTimeout(2500)When an Invocation Times Out
An invocation timeout affects only the client: Ice does not notify the server, which can still be dispatching the request, and Ice ignores the reply if the server sends one. Ice does not retry an invocation that times out.