[ https://issues.apache.org/jira/browse/GEODE-5256?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Juan José Ramos Cassella resolved GEODE-5256. --------------------------------------------- Resolution: Fixed Fix Version/s: 1.7.0 > GFSH Start Server Command Parameters Overridden by Default Values > ----------------------------------------------------------------- > > Key: GEODE-5256 > URL: https://issues.apache.org/jira/browse/GEODE-5256 > Project: Geode > Issue Type: Bug > Components: gfsh > Reporter: Juan José Ramos Cassella > Assignee: Juan José Ramos Cassella > Priority: Major > Labels: pull-request-available > Fix For: 1.7.0 > > Attachments: workspace.zip > > Time Spent: 1h 50m > Remaining Estimate: 0h > > Hello team, > The order on which we apply the cache configuration vs the startup parameters > when starting servers through {{gfs}} seems to be wrong. > No matter whether the cache is configured through a local {{cache.xml}} or > the cluster configuration service, internally we end up parsing the > configuration using {{CacheXmlParser}} and {{CacheCreation}} classes. The > class {{CacheCreation}} creates a server through {{CacheServerCreation}} and > this one extends {{AbstractCacheServer}}, which has some default values > configured, overriding the values set by the startup parameters. > I've been able to reproduce this for the {{max-connections}} configuration > property specifically but right now a bunch of parameters are completely > ignored if a {{cache.xml}} file is specified or if the > {{cluster-configuration-service}} is enabled, no matter if the actual > parameter is specifically configured or not, the default values are always > used. In fact, the only parameters that seem to override the {{cache.xml}} / > {{cluster-configuration}} are {{serverPort}}, {{serverBindAddress}} and > {{disableDefaultServer}}, they are communicated between the > {{ServerLauncher}} and {{CacheCreation}} classes through public static fields > in the {{CacheServerLauncher}} class. > As an example, after adding some extra logging on the > {{setMaxConnections()}} method, below is the output shown when starting the > server: > {noformat} > ######## gfsh start server --name=server1 --server-port=40401 > --locators=localhost[10101] --max-connections=1033 > [info 2018/05/25 13:55:20.752 IST server1 <main> tid=0x1] Initialization of > region PdxTypes completed > [XXXXX]: CacheServerImpl.setMaxConnections() is changing maxConnections from > 800 to 1033. > java.lang.Throwable > at > org.apache.geode.internal.cache.CacheServerImpl.setMaxConnections(CacheServerImpl.java:209) > at > org.apache.geode.distributed.ServerLauncher.startCacheServer(ServerLauncher.java:956) > at > org.apache.geode.distributed.ServerLauncher.start(ServerLauncher.java:781) > at > org.apache.geode.distributed.ServerLauncher.run(ServerLauncher.java:692) > at > org.apache.geode.distributed.ServerLauncher.main(ServerLauncher.java:225) > [info 2018/05/25 13:55:20.825 IST server1 <main> tid=0x1] CacheServer > Configuration: port=40401 max-connections=1033 max-threads=0 > notify-by-subscription=true socket-buffer-size=32768 > maximum-time-between-pings=60000 maximum-message-count=230000 > message-time-to-live=180 eviction-policy=none capacity=1 overflow directory=. > groups=[] loadProbe=ConnectionCountProbe loadPollInterval=5000 tcpNoDelay=true > ######## gfsh -e start server --name=server1 --server-port=40401 > --locators=localhost[10101] --max-connections=1033 > --cache-xml-file=$CURRENT_DIRECTORY/server-cache.xml > [info 2018/05/25 13:56:19.593 IST server1 <main> tid=0x1] Initialization of > region PdxTypes completed > [XXXXX]: CacheServerImpl.setMaxConnections() is changing maxConnections from > 800 to 800. > java.lang.Throwable > at > org.apache.geode.internal.cache.CacheServerImpl.setMaxConnections(CacheServerImpl.java:209) > at > org.apache.geode.internal.cache.CacheServerImpl.configureFrom(CacheServerImpl.java:304) > at > org.apache.geode.internal.cache.xmlcache.CacheCreation.startCacheServers(CacheCreation.java:688) > at > org.apache.geode.internal.cache.xmlcache.CacheCreation.create(CacheCreation.java:581) > at > org.apache.geode.internal.cache.xmlcache.CacheXmlParser.create(CacheXmlParser.java:337) > at > org.apache.geode.internal.cache.GemFireCacheImpl.loadCacheXml(GemFireCacheImpl.java:4307) > at > org.apache.geode.internal.cache.GemFireCacheImpl.initializeDeclarativeCache(GemFireCacheImpl.java:1434) > at > org.apache.geode.internal.cache.GemFireCacheImpl.initialize(GemFireCacheImpl.java:1226) > at > org.apache.geode.internal.cache.GemFireCacheImpl.basicCreate(GemFireCacheImpl.java:792) > at > org.apache.geode.internal.cache.GemFireCacheImpl.create(GemFireCacheImpl.java:778) > at org.apache.geode.cache.CacheFactory.create(CacheFactory.java:177) > at org.apache.geode.cache.CacheFactory.create(CacheFactory.java:224) > at > org.apache.geode.distributed.internal.DefaultServerLauncherCacheProvider.createCache(DefaultServerLauncherCacheProvider.java:52) > at > org.apache.geode.distributed.ServerLauncher.createCache(ServerLauncher.java:844) > at > org.apache.geode.distributed.ServerLauncher.start(ServerLauncher.java:762) > at > org.apache.geode.distributed.ServerLauncher.run(ServerLauncher.java:692) > at > org.apache.geode.distributed.ServerLauncher.main(ServerLauncher.java:225) > [info 2018/05/25 13:56:19.929 IST server1 <main> tid=0x1] CacheServer > Configuration: port=40401 max-connections=800 max-threads=0 > notify-by-subscription=true socket-buffer-size=32768 > maximum-time-between-pings=60000 maximum-message-count=230000 > message-time-to-live=180 eviction-policy=none capacity=1 overflow directory=. > groups=[] loadProbe=ConnectionCountProbe loadPollInterval=5000 tcpNoDelay=true > {noformat} > A reproducible scenario is attached to the JIRA. > Cheers. -- This message was sent by Atlassian JIRA (v7.6.3#76005)