Archived

This forum has been archived. Please start a new discussion on GitHub.

proxies and timeouts

I have a question about timeouts.
Every once in a while a connection hangs. It's hard to tell what the cause is.
One possibility which I would like to eliminate to help debuggin is that the proxy was set to timeout=-1.

I can't find a way to do this systematically however.

I have a few wrapper functions for establishing connections which are used throughout the code. In these functions, my plan was to determine what timeout the proxy currently is set to and, if it's set to -1, replace it with some finite default.

Apparently, there's no Ice::ObjectPrx::ice_getTimeout(). Is there a reason for this? I suppose I could stringify and parse it, but it seems like an awkward way to do it.

Of course, what I am trying to do by hand is implement something which could've been called Ice.Default.Timeout -- similar to Ice.Override.Timeout but which would only apply to the proxies whose timeout is "not set", i.e. set to infinity.

It would be good to hear someone's opinion on this.

Thanks for you support,
Alex

Comments

  • Hi Alex,

    you are right, there is no way to get the timeout back out of a proxy, other than by stringifying it. That's an oversight--it should be possible to ask a proxy for its timeout value. We'll discuss adding this for the next release.

    There is no property such as the one you suggest. We've never had a need for this (up to now) and, internally, we don't distinguish between a proxy that has no timeout set and a proxy that uses the default infinite timeout.

    I'm afraid that the approach you suggested (stringifying the proxy to the get the timeout) is the only viable option at this time.

    Cheers,

    Michi.
  • matthew
    matthew NL, Canada
    I would think a better solution would be to ensure that all proxies have a suitable timeout set either at the point of creation, or at the point that your application takes "ownership" of the proxy.
  • Thanks for your replies guys.
    Good to know I wasn't missing something.
    I'll start by following Matthew's suggestion and will see how I go.

    Alex.
  • matthew
    matthew NL, Canada
    You should note that the timeouts, unless overridden on the proxy by calling ice_timeout, are on an endpoint basis. What this means in practice is if you have multiple endpoints the timeout you get could differ depending on which endpoint Ice used to establish the connection and on the connection caching policy you've set on the proxy. As such, I think parsing the stringified form of the proxy to determine the timeout (which timeout?) is very fragile, and might provide surprising results as your system evolves. For example, what would happen if you add fault tolerance to some of your interfaces?