[ 
https://issues.apache.org/jira/browse/CURATOR-94?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13925000#comment-13925000
 ] 

ASF GitHub Bot commented on CURATOR-94:
---------------------------------------

GitHub user dtrott opened a pull request:

    https://github.com/apache/curator/pull/2

    Curator 94

    https://issues.apache.org/jira/browse/CURATOR-94
    
    Added some docs (based on my understanding) for ServiceType
    
    Updated ServiceDiscoveryImpl.registerService so that PERMANENT 
registrations are not stored within the service.
    
    This is to prevent two side effects:
    
    When the ServiceDiscoveryImpl class is closed all PERMANENT registrations 
are deleted.
    This is not desireable since callers who create PERMANENT registations 
should expect them to survive until explicitly deleted.
    
    PERMANENT registrations should be stateless with respect to a particular 
service discovery client (assume a cluster of rest services).
    It should be possible to use any of them to register/unregister.
    It is not desirable to keep re-registering them whenever the client 
losses/reconnects to Zookeeper.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/dtrott/curator CURATOR-94

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/curator/pull/2.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2
    
----
commit 877eb55c93dc284339a86fdaf678ceba0674d808
Author: David Trott <[email protected]>
Date:   2014-03-08T20:29:50Z

    Documented ServiceType's.

commit baf596723ee006391376ad62df8f957fb98e7846
Author: David Trott <[email protected]>
Date:   2014-03-08T20:35:03Z

    Updated ServiceDiscoveryImpl.registerService so that PERMANENT 
registrations are not stored within the service.
    
    This is to prevent two side effects:
    
    When the ServiceDiscoveryImpl class is closed all PERMANENT registrations 
are deleted.
    This is not desireable since callers who create PERMANENT registations 
should expect them to survive until explicitly deleted.
    
    PERMANENT registrations should be stateless with respect to a particular 
service discovery client (assume a cluster of rest services).
    It should be possible to use any of them to register/unregister.
    It is not desirable to keep re-registering them whenever the client 
losses/reconnects to Zookeeper.

----


> PERMANENT registration should not be added to the services map.
> ---------------------------------------------------------------
>
>                 Key: CURATOR-94
>                 URL: https://issues.apache.org/jira/browse/CURATOR-94
>             Project: Apache Curator
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: 2.4.0
>            Reporter: David Trott
>
> In ServiceDiscoveryImpl the registerService(...) method should be:
>     {
>         if (service.getServiceType() == ServiceType.STATIC)
>         {
>             services.put(service.getId(), service);
>         }
>         internalRegisterService(service);
>     }
> This prevents two side effects:
> + PERMANENT registration are not deleted when the ServiceDiscoveryImpl class 
> is closed.
> + PERMANENT registration are not re-registered (potentially with old data) 
> after a connection loss event.
> The first case is a problem, since shutting down the registration app cleanly 
> deletes all PERMANENT registrations.
> Additionally since PERMANENT registrations do not use ephemeral nodes the 
> re-registration functionality is not needed.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to