Archived

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

object registration with activate()

We are considering situations when an application with servants initializes while the IceGrid Registry is unreachable, e.g. the network is not up yet or was lost temporarily, etc.

What seems to happen is that ObjectAdapter::activate() throws ConnectionRefusedException. If I catch it and try to activate again (after the Registry is reachable) no exception is thrown but the objects remain unregistered. Calling deactivate() does not seem right according to the documentation.

A possible solution is to try to ping the Registry before calling activate(). Is that the right/only approach? Can I force the adapter to (re)register its objects after its activation?

Thanks, alex

Comments

  • benoit
    benoit Rennes, France
    Hi Alex,

    Yes, unfortunately ObjectAdapter::activate() only tries once to register the adapter with the registry.

    Is the server managed by an IceGrid node? If that's the case, the best would be to just shutdown the server, no clients will be able to reach it anyway since the registry is down. Once the registry comes up again, if will be activated again on demand (assuming the activation mode is on-demand) if a client invokes on an indirect proxy of the server -- this time the server should be able to register its endpoints with the registry.

    Another solution would be to do the registration of the object adapter endpoints yourself if it fails. You can do this with the Ice::LocatorRegistry interface, you'll find the code to do this in Ice sources, in the implementation of ObjectAdapterI::activate() (src/Ice/ObjectAdapterI.cpp).

    In any case, we'll look into improving the behavior of activate(), I think it would be better if it failed completely and if it was possible to call it again to try again the adapter activation. Thanks for bringing this to our attention!

    Cheers,
    Benoit.
  • >Is the server managed by an IceGrid node? If that's the case, the best would

    no, we don't use IG Node at the moment.

    > Another solution would be to do the registration of the object adapter
    > endpoints yourself if it fails. You can do this with the Ice::LocatorRegistry
    > interface, you'll find the code to do this in Ice sources, in the implementation
    > of ObjectAdapterI::activate() (src/Ice/ObjectAdapterI.cpp).

    ok, i'll take a look at that.

    > In any case, we'll look into improving the behavior of activate(), I think it would
    > be better if it failed completely and if it was possible to call it again to try
    > again the adapter activation. Thanks for bringing this to our attention!

    great, I agree. it'd be good to have a bit more control over the registration process which is a single point of failure when using indirect bindings. I understand that the idea is to make it completely transparent and it works very well ... when everything goes well :)

    thanks for your help, alex
  • benoit wrote: »
    Hi Alex,

    Yes, unfortunately ObjectAdapter::activate() only tries once to register the adapter with the registry.

    Is the server managed by an IceGrid node? If that's the case, the best would be to just shutdown the server, no clients will be able to reach it anyway since the registry is down. Once the registry comes up again, if will be activated again on demand (assuming the activation mode is on-demand) if a client invokes on an indirect proxy of the server -- this time the server should be able to register its endpoints with the registry.

    Another solution would be to do the registration of the object adapter endpoints yourself if it fails. You can do this with the Ice::LocatorRegistry interface, you'll find the code to do this in Ice sources, in the implementation of ObjectAdapterI::activate() (src/Ice/ObjectAdapterI.cpp).

    In any case, we'll look into improving the behavior of activate(), I think it would be better if it failed completely and if it was possible to call it again to try again the adapter activation. Thanks for bringing this to our attention!

    I met the similar situations:the network may lost temporarily, I could do the registration of the object adapter endpoints myself with Ice::LocatorRegistry , could not I?

    Had the behavior of activate() improved?