Results 1 to 5 of 5

Thread: Server, running on IceGridNode, doesn't stop when inheriting handles

  1. #1
    andy_84 is offline Registered User
    Name: Andrew Solovyov
    Organization: MAI
    Project: simple grid-like system
    Join Date
    Nov 2010
    Posts
    27

    Server, running on IceGridNode, doesn't stop when inheriting handles

    Hi all.

    I have the following IceGrid: 2 nodes, one running server A, exchanging data with server B, running on the other node (doesn't matter whether both nodes are running on the same computer or not). Server B calls CreateProcess to run a separate App (for example, notepad.exe).

    The problem is that if I stop server A through IceGridGUI or icegridadmin.exe, and App was started inheriting handles of server B - A hangs for a minute, then stops. If I kill App - server A stops instantly. If App doesn't inherit B's handles - A stops instantly.

    ProcessExplorer shows that App inherits from server B several objects of type 'File' with name '\Device\Afd'.
    TCPView shows a single established connection between A and B, which disappeares only in a minute after I stop server A.

    Trace:

    -- 05/04/11 10:54:48.875 A.server: Network: sent 14 of 14 bytes via tcp
    local address = 172.16.130.31:34454
    remote address = 172.16.130.31:34453

    but there is no corresponding 'Network: closing tcp connection' message for this ports, like this:

    -- 05/04/11 10:54:48.875 A.server: Network: sent 14 of 14 bytes via tcp
    local address = 172.16.130.31:34460
    remote address = 172.16.130.31:32412
    -- 05/04/11 10:54:48.875 A.server: Network: closing tcp connection
    local address = 172.16.130.31:34460
    remote address = 172.16.130.31:32412

    In my scenario server A might not send any stop signal to server B, causing App to stop, and I need to stop A instantly. How can I achieve this?

    Windows XP x64, ICE 3.4.1.

    Thanks.

  2. #2
    bernard's Avatar
    bernard is offline ZeroC Staff
    Name: Bernard Normier
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Palm Beach Gardens, FL
    Posts
    1,294
    Hi Andy,

    Could you clarify the interactions between server A and server B: is server A sending requests to server B (and waiting for responses from B), or vice versa?

    Did you try to attach to server A while it's stopping slowly, to see what it's waiting for?

    Best regards,
    Bernard
    Bernard Normier
    ZeroC, Inc.

  3. #3
    andy_84 is offline Registered User
    Name: Andrew Solovyov
    Organization: MAI
    Project: simple grid-like system
    Join Date
    Nov 2010
    Posts
    27
    Hi! Thanks for paying attention.

    Server A sends async requests to B, while B is making sync requests to A through a oneway proxy.

    Yes, I've tried, A is waiting here:

    void
    Ice::ConnectionI::waitUntilFinished()
    {
    IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);

    //
    // We wait indefinitely until the connection is finished and all
    // outstanding requests are completed. Otherwise we couldn't
    // guarantee that there are no outstanding calls when deactivate()
    // is called on the servant locators.
    //
    while(_state < StateFinished || _dispatchCount > 0)
    {
    wait(); <--- is waiting here
    }

    ...

    This is the same connection TCPView shows me. I'm worrying that inheriting handles is the real cause - App must inherit B's handles...

    Regards, Andy.

  4. #4
    benoit's Avatar
    benoit is offline ZeroC Staff
    Name: Benoit Foucher
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Rennes, France
    Posts
    2,196
    Hi,

    Yes, this is expected when inheriting the handles. The forked App process gets a handle on the TCP/IP connection established between A and B. A TCP/IP socket connection gets closed only once all the handles are closed (so here both B and App should close the socket handle for the TCP/IP connection to close).

    Ice graceful connection closure waits for the peer to close the connection before considering the connection to be closed (see 36.6.1 here) and this is what is happening here: A waits for B to close its side of the TCP/IP connection to shutdown.

    You should either not inherit handles or use a smaller close timeout (you can override the close timeout with Ice.Override.CloseTimeout in Ice >= 3.4.x).

    Cheers,
    Benoit.

  5. #5
    andy_84 is offline Registered User
    Name: Andrew Solovyov
    Organization: MAI
    Project: simple grid-like system
    Join Date
    Nov 2010
    Posts
    27
    Benoit, great thanks!

    By the way, Ice.Override.CloseTimeout is not mentioned in ICE 3.4.1 manual, only here http://download.zeroc.com/Ice/3.4/Ice-3.4.1-CHANGES

    Regards, Andy
    Last edited by andy_84; 05-06-2011 at 01:28 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 4
    Last Post: 01-26-2010, 11:32 AM
  2. Running server as `root' is not allowed
    By jesse in forum Help Center
    Replies: 6
    Last Post: 02-01-2008, 12:21 PM
  3. Signals masked when running under icegridnode?
    By joshmoore in forum Help Center
    Replies: 2
    Last Post: 02-01-2008, 08:32 AM
  4. running sample server error on rh9
    By a2234 in forum Help Center
    Replies: 1
    Last Post: 10-12-2004, 10:50 PM
  5. error running Java server on XP
    By dipakyadav in forum Bug Reports
    Replies: 9
    Last Post: 02-21-2003, 10:42 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
  •