You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2019/03/27 23:31:00 UTC
[jira] [Commented] (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:comment-tabpanel&focusedCommentId=16803461#comment-16803461 ]
ASF subversion and git services commented on GEODE-6562:
--------------------------------------------------------
Commit 4848ef55385f241a3e888b4cfa1cc2030ca40217 in geode's branch refs/heads/develop from Kirk Lund
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=4848ef5 ]
GEODE-6562: Inject new DistributedSystem into Locator Cache (#3364)
Prevents startLocatorAndDS from creating two DistributedSystem
connections when ALLOWS_MULTIPLE_SYSTEMS.
> 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
> 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
(v7.6.3#76005)