You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Dick Cavender (Jira)" <ji...@apache.org> on 2019/09/26 18:05:08 UTC

[jira] [Closed] (GEODE-6562) Locator.startLocatorAndDS creates two DistributedSystem connections when ALLOW_MULTIPLE_SYSTEMS is true

     [ https://issues.apache.org/jira/browse/GEODE-6562?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dick Cavender closed GEODE-6562.
--------------------------------

> Locator.startLocatorAndDS creates two DistributedSystem connections when ALLOW_MULTIPLE_SYSTEMS is true
> -------------------------------------------------------------------------------------------------------
>
>                 Key: GEODE-6562
>                 URL: https://issues.apache.org/jira/browse/GEODE-6562
>             Project: Geode
>          Issue Type: Bug
>          Components: core
>            Reporter: Kirk Lund
>            Assignee: Kirk Lund
>            Priority: Minor
>             Fix For: 1.10.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> This is observable with MultipleCacheJUnitTest: 
> {noformat}
> 57:  @Before
> 58:  public void startLocator() throws IOException {
> 59:    InternalDistributedSystem.ALLOW_MULTIPLE_SYSTEMS = true;
> 60:    locator = Locator.startLocatorAndDS(0, locatorFolder.newFile("locator.log"), null);
> 61:    props = new Properties();
> 62:    props.setProperty(ConfigurationProperties.LOCATORS, "locahost[" + locator.getPort() + "]");
> 63:  }
> {noformat}
> InternalLocator.startDistributedSystem() creates a DS connection and then passes it to startCache:
> {noformat}
> 597:  private void startDistributedSystem() throws UnknownHostException {
> ...
> 648:      this.myDs = (InternalDistributedSystem) DistributedSystem.connect(connectEnv);
> ...
> 661:      startCache(myDs);
> {noformat}
> But then InternalLocator.startCache(DistributedSystem) creates a new Cache without using the DistributedSystem passed in (it only uses its properties):
> {noformat}
> 670:  private void startCache(DistributedSystem ds) {
> ...
> 674:      this.myCache = (InternalCache) new CacheFactory(ds.getProperties()).create();
> {noformat}
> Because of the way that CacheFactory was implemented to support ALLOW_MULTIPLE_SYSTEMS, it always creates a new instance of DistributedSystem. That old behavior was carried forward to the new InternalCacheBuilder which CacheFactory now delegates to.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)