ice icon indicating copy to clipboard operation
ice copied to clipboard

Simplify IceGrid instance name computation

Open externl opened this issue 1 year ago • 1 comments

We currently have a complicated process for determining the IceGrid instance name:

    // The IceGrid instance name. We can't use getIceProperty as we don't want to get any default values.
    string instanceName = properties->getProperty("IceGrid.InstanceName");
    if (instanceName.empty())
    {
        instanceName = properties->getProperty("IceLocatorDiscovery.InstanceName");
    }
    if (instanceName.empty())
    {
        instanceName = communicator()->getDefaultLocator()->ice_getIdentity().category;
    }
    if (instanceName.empty())
    {
        instanceName = "IceGrid";
    }

I've yet to find anywhere that we document this in the docs. I think we should just use IceGrid.InstanceName

externl avatar Nov 12 '24 15:11 externl

We rely on the Ice.Default.Locator -derived instance name for the config files we ship, so we can't change this logic.

https://github.com/zeroc-ice/ice/blob/main/cpp/config/icegridnode.cfg

We should however fix the doc.

bernardnormier avatar Nov 12 '24 16:11 bernardnormier

Added description for default in IceGrid.InstanceName.

bernardnormier avatar Sep 04 '25 21:09 bernardnormier