Archived

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

icepacknode doesn't work after reboot! help!

I start icepacknode and icepackregistry on the same machine as NT Service.

for the first time, i start icepackregistry, and then icepacknode, things go well. Then I turned icepacknode into manual start, for I know it must be started after icepackregistry, then I reboot my machine (WindowsXP), at this time, both icepacknode and icepackregistry are running. as windows shutting down i see an Error occured for icepackregistry.

then, when my machine start again, i found icepackregistry restart successfully. then i start icepacknode manually, it success. i use icepackadmin to list node, it works. but when i try to 'node ping' that node, it wait forever.

somebody can help me?

Comments

  • I use Ice-2.0
  • benoit
    benoit Rennes, France
    Can you try to run manually the registry and node with some additional tracing to see if this can gives some more clues? You can use the following properties:
    Ice.Trace.Network=2
    Ice.Trace.Protocol=1
    IcePack.Registry.Trace.NodeRegistry=1
    

    Benoit.
  • I've found the answer, now!

    This is because I use one config for both registry and node, and they share the same timeout property. And when I review the code, the registry need register the node, but before doing that, it searches its persistence data, there has one record, so it try to checkedCast that non-exsist proxy, so it always timeout. so, node always timeout first, and then registry timeout, a bad loop back ouccrs.

    So if you want to use both registry and node on the same machine, try to use two config file, and set node timeout much longer than registry's timeout.

    my config is:
    node 10 sec
    registry 120 sec

    this works for me.
  • code are like this:

    first, node call nodeRegistry->add(name, nodeProxy)
    then, registry add() call findByName()
    then, findByName() try to return NodePrx::checkedCast(p->second)
    then, node timeout
    then, findByName() timeout, and got LocalException, but it's no use now because the node is not there listenning to you :-(
    IcePackNode.cpp
    
    bool
    IcePack::NodeService::start(int argc, char* argv[])
    {
        ...
        //
        // Register this node with the node registry.
        //
        try
        {
            NodeRegistryPrx nodeRegistry = NodeRegistryPrx::checkedCast(
                communicator()->stringToProxy("IcePack/NodeRegistry@IcePack.Registry.Internal"));
            nodeRegistry->add(name, nodeProxy);
        }
        catch(const NodeActiveException&)
        {
            error("a node with the same name is already registered and active");
            return false;
        }
        catch(const LocalException&)
        {
            error("couldn't contact the IcePack registry");
            return false;
        }
        ....
    }
    
    NodeRegistryI.cpp
    
    void
    IcePack::NodeRegistryI::add(const string& name, const NodePrx& node, const Ice::Current& current)
    {
        while(true)
        {
    	NodePrx oldNode;
    	try
    	{
    	    oldNode = findByName(name, current);
    	    oldNode->ice_ping();
    	    throw NodeActiveException();
    	}
    	catch(const NodeNotExistException&)
    	{
    	}
    	catch(const Ice::LocalException&)
    	{
    	}
         ...
    }
    
    NodePrx
    IcePack::NodeRegistryI::findByName(const string& name, const Ice::Current&)
    {
        Freeze::ConnectionPtr connection = Freeze::createConnection(_communicator, _envName);
        StringObjectProxyDict dict(connection, _dbName); 
    
        StringObjectProxyDict::iterator p = dict.find(name);
        if(p != dict.end())
        {
    	try
    	{
    	    return NodePrx::checkedCast(p->second);
    	}
    	catch(const Ice::ObjectNotExistException&)
    	{
    	}
    	catch(const Ice::LocalException&)
    	{
    	    return NodePrx::uncheckedCast(p->second);
    	}
        }
        throw NodeNotExistException();
    }