checkcast blocked, Is a bug??

eaglecneaglecn Yong WANGOrganization: ICT,chinaProject: DBrokerMember
Clients acess server using IcePack.But under some cricumstance, checkcast(base) will be block forever.

in detail, client code is as following:
            //set parameter of timeout
            props1->setProperty("Ice.Default.Locator",
                                "IcePack/Locator:default -p 12000  -t "
                                + reg1_t + " -h " + reg[i]); 
            props1->             
                setProperty("IcePack.Registry.Client.Endpoints",
                            "default -p 12000  -t " + reg1_t + 
                            " -h " + reg[i]);   
            
            ic = Ice::initializeWithProperties(argc, argv, props1);
            query = 
                IcePack::QueryPrx::checkedCast(ic->
                                               stringToProxy
                                               ("IcePack/Query"));

                    base = query->findObjectByType("::NetDB::MDataQuery");
                    [B]QueryPrx_1 = MDataQueryPrx::checkedCast(base);[/B]

When my server crashed and was activated again, the older or new clients could be blocked some times(not always). I check the server using logfile and debug, it was running normally as that time. icepackadmin showed that the newly activated server had been recoginzed. After i kill the server mannully, new clients worked well, but old clients were still blocked.

So, How can i locate this problem and when checkcast can be blocked, or how can i avoid it? set timeout?

Comments

  • benoitbenoit Rennes, FranceBenoit FoucherOrganization: ZeroC, Inc.Project: IceAdministrators, ZeroC Staff ZeroC Staff
    Hi,

    Yes, you should set a timeout to make sure the twoway invocation will eventually return with an Ice::TimeoutException exception. The checkedCast call might block if there's a problem with your server (perhaps a deadlock?) or a network connectivity issue. You should consider upgrding your application to use the latest Ice version, IcePack is quite old now.

    Cheers,
    Benoit.
  • eaglecneaglecn Yong WANGOrganization: ICT,chinaProject: DBrokerMember
    Appreciation for your reply, benoit.
    Let upgradation of ICE alone for instant.
    My real trouble is server crash and activation may be fall into a endless block, unless restart both client and server even the network connectivity is normal.

    I can understand why the Icepack recognized service correctly(status, PID), but checkcast blocked? My unstanding is it should be successful(ok) or failed(without explicite timeout)

    I would rather think my server surffer some problems(but not deadlock, I think). So, may i know, what happened during the checkcast(), so i can debug my server.

    Ice upgradation may be the last straw, although I do believe it's helpful, for some side-effect for our complex system.
  • benoitbenoit Rennes, FranceBenoit FoucherOrganization: ZeroC, Inc.Project: IceAdministrators, ZeroC Staff ZeroC Staff
    Hi,

    Depending on your network (if for example there's multiple routers or firewall between the client and server), it's possible that it takes a very long time for the client to detect the connection closure from the server if it crashed. In this case, you don't have other choices but to use timeouts. That being said, if the client and server are running on the same internal network, this shouldn't be the case.

    In any case, it's impossible to say why exactly the checkedCast() call could be blocked without more information (Ice version, OS version, etc). The best would be to get a stack trace of the thread blocked on this call to see what it's doing.

    Note that this also goes a bit beyond the free support we can provide on these forums, especially since you're using an old Ice version. You should consider purchasing commercial support or consulting services if you need help with this. Please contact [email protected] if you're interested.

    Cheers,
    Benoit.
Sign In or Register to comment.