Results 1 to 5 of 5

Thread: RPC hangs when host gets disconnected from network

  1. #1
    timruijs is offline Registered User
    Name: Tim Ruijs
    Organization: Vialis
    Project: Publish/Subscribe Framework
    Join Date
    Jul 2004
    Location
    Leusden
    Posts
    11

    RPC hangs when host gets disconnected from network

    Little background:
    In our system we have an event dispatcher that distributes events to subscribers (both locally and remote). A thread retrieves an event from the event queue, invokes the method on the subscriber to deliver the event, returns and continues monitoring the queue for other events.

    Consider the following scenario:
    the publisher host has two event dispatchers for different events running. A subscriber on a remote host subscribes to both events. Both event types are generated about ten times a second. When we disconnect the subscriber host from the network, one of the event handlers appears to block (we think in TCP?), but the other gets an exception from Ice. We would rather have both event threads throw exceptions and return control. The problem is that one queue starts to fill with events. What is going on?

    More info can be provided when required, thanx

  2. #2
    marc's Avatar
    marc is offline ZeroC Staff
    Name: Marc Laukien
    Organization: ZeroC, Inc.
    Project: The Internet Communications Engine
    Join Date
    Feb 2003
    Location
    Florida
    Posts
    1,860
    It is not always possible for the TCP/IP stack to detect a lost connection. For example, if you just "cut the cable", the TCP/IP stack may not be able to detect a connection loss until the TCP/IP timeout kicks in, which might take very long.

    The solution is to set a timeout in Ice. This way, if a request blocks, Ice will raise an exception, even if the TCP/IP stack cannot detect a connection loss.

  3. #3
    timruijs is offline Registered User
    Name: Tim Ruijs
    Organization: Vialis
    Project: Publish/Subscribe Framework
    Join Date
    Jul 2004
    Location
    Leusden
    Posts
    11
    We use Ice 3.2.0.

    Thanks for your quick response.
    We set the timeout in the proxy like is shown below.

    iSubscriberPrx tmpPrx = iSubscriberPrx::uncheckedCast((publishCallbackPtr->Prx)->ice_timeout(publishCallbackPtr->TopicProperties.mDeliveryTimeOut));

    if ( tmpPrx )
    {
    tmpPrx->OnTopic(publishCallbackPtr->Topic, publishCallbackPtr->PublisherTag );
    }

    mDeliveryTimeOut = 15000 (mSec)

    Agreed that TCP/IP can not always properly detect connection loss, that is exactly why we use the timeout.
    The strange thing is that we do get an exception for one of the threads, but the other blocks, even with timeout set. When we reconnect the network, the last message of the blocking thread is finished and the thread continues happily.

  4. #4
    marc's Avatar
    marc is offline ZeroC Staff
    Name: Marc Laukien
    Organization: ZeroC, Inc.
    Project: The Internet Communications Engine
    Join Date
    Feb 2003
    Location
    Florida
    Posts
    1,860
    If you set a timeout, the call should not block. Note, however, that timeouts sometimes can take longer than the timeout value. See this FAQ.

    In any case, I'm afraid without a concrete example that demonstrates the problem, it's not possible to tell what the problem is.

    Note that we only provide limited free support for the latest version of Ice here in these forums. While I'm not aware of any specific problem in Ice 3.2 with respect to timeouts, I still recommend to upgrade to the latest version of Ice.

  5. #5
    timruijs is offline Registered User
    Name: Tim Ruijs
    Organization: Vialis
    Project: Publish/Subscribe Framework
    Join Date
    Jul 2004
    Location
    Leusden
    Posts
    11
    Vialis is a long term licensee of ICE.
    Unfortunately we cannot simply update to a newer version of ICE (risk, validation/certification etc).

    The problem with a concrete example is that this concerns our event framework which is quite complex. We do use our own locator, could that possibly interfere with the timeout mechanism?

    Our locator registers local objects(on the same host where locator runs). Indirect proxies are used to access remote objects which contain the id of the locator on the remote host.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Two-way RPC connection between Silverlight4 and iOS4
    By EvgeniPetrov in forum Help Center
    Replies: 6
    Last Post: 10-03-2011, 04:57 AM
  2. Windows IPC/RPC technology question
    By MartinBa in forum Comments
    Replies: 0
    Last Post: 01-31-2011, 11:53 AM
  3. network disconnected
    By alexnycheung in forum Help Center
    Replies: 7
    Last Post: 10-07-2009, 05:09 PM
  4. server disconnected
    By alexnycheung in forum Help Center
    Replies: 1
    Last Post: 06-17-2009, 03:03 PM
  5. Does Ice support reversed rpc call in a connection?
    By timeguest in forum Help Center
    Replies: 1
    Last Post: 04-25-2005, 02:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •