You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Kirk Lund (JIRA)" <ji...@apache.org> on 2019/03/26 17:15:00 UTC

[jira] [Assigned] (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 ]

Kirk Lund reassigned GEODE-6562:
--------------------------------

    Assignee: Dan Smith

> 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: Dan Smith
>            Priority: Major
>
> This is observable with MultipleCacheJUnitTest: 
> {noformat}
> 1:  @Before
> 2:  public void startLocator() throws IOException {
> 3:    InternalDistributedSystem.ALLOW_MULTIPLE_SYSTEMS = true;
> 4:    locator = Locator.startLocatorAndDS(0, locatorFolder.newFile("locator.log"), null);
> 5:    props = new Properties();
> 6:    props.setProperty(ConfigurationProperties.LOCATORS, "locahost[" + locator.getPort() + "]");
> 7:  }
> {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.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)