[
https://issues.apache.org/jira/browse/CURATOR-94?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13924807#comment-13924807
]
David Trott commented on CURATOR-94:
------------------------------------
Actually, I think the condition should be:
if (service.getServiceType() != ServiceType.PERMANENT)
Since there may be a DYNAMIC registration which will need to be renewed after a
connection loss.
> 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)