[
https://issues.apache.org/jira/browse/GEODE-6863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16867817#comment-16867817
]
ASF subversion and git services commented on GEODE-6863:
--------------------------------------------------------
Commit 867307dc8d8f51f57a58ac194c9e3c83170d827e in geode's branch
refs/heads/develop from Nabarun Nag
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=867307d ]
GEODE-6863: Ignoring IllegalStateException (#3719)
* Ignoring IllegalStateException if the server is no more running.
* If the server is not running then getting external address will
result in IllegalStateException.
* The server may shut down in between isRunning and getExternalAddress
calls.
* If this happens then the server is not added to the location list of
the servers hosting bucket.
> CI failure: A cache server's bind address is only available if it has been
> started
> ----------------------------------------------------------------------------------
>
> Key: GEODE-6863
> URL: https://issues.apache.org/jira/browse/GEODE-6863
> Project: Geode
> Issue Type: Bug
> Components: core
> Reporter: Darrel Schneider
> Priority: Major
> Time Spent: 2.5h
> Remaining Estimate: 0h
>
> This looks like an existing issue that has a very small window of time in
> which it can fail.
> It should not be hard to fix.
> See: http://hydradb.gemfire.pivotal.io/hdb/testresult/5751289
> I think the place to fix this is in
> org.apache.geode.internal.cache.BucketAdvisor.instantiateProfile(InternalDistributedMember,
> int)
> It does a test if the server is running and then calls getExternalAddress
> twice. If the server is stopped after the isRunning check but before
> getExternalAddress is called then getExternalAddress will throw the
> IllegalStateException. The following "if" block could be put in a try/catch
> that catches IllegalStateException and ignores and skips that server if it is
> no longer running.
> Another possible fix would be to call getExternalAddress(false) which does
> not throw IllegalStateException and then right before adding to
> serverLocations do a check that the server is running. Here is the code that
> needs to be fixed:
> {code:java}
> for (CacheServer cacheServer : servers) {
> CacheServerImpl server = (CacheServerImpl) cacheServer;
> if (server.isRunning() && (server.getExternalAddress() != null)) {
> BucketServerLocation66 location = new
> BucketServerLocation66(getBucket().getId(),
> server.getPort(), server.getExternalAddress(),
> getBucket().isPrimary(),
> Integer.valueOf(version).byteValue(),
> server.getCombinedGroups());
> serverLocations.add(location);
> }
> }
> {code}
> {noformat}
> Found suspect string in log4j at line 4995
> [error 2019/06/13 18:35:08.681 GMT <Pooled Waiting Message Processor 1>
> tid=62] A cache server's bind address is only available if it has been started
> java.lang.IllegalStateException: A cache server's bind address is only
> available if it has been started
> at
> org.apache.geode.internal.cache.CacheServerImpl.getExternalAddress(CacheServerImpl.java:435)
> at
> org.apache.geode.internal.cache.CacheServerImpl.getExternalAddress(CacheServerImpl.java:427)
> at
> org.apache.geode.internal.cache.BucketAdvisor.instantiateProfile(BucketAdvisor.java:1611)
> at
> org.apache.geode.distributed.internal.DistributionAdvisor.createProfile(DistributionAdvisor.java:1008)
> at
> org.apache.geode.internal.cache.BucketAdvisor.sendProfileUpdate(BucketAdvisor.java:1576)
> at
> org.apache.geode.internal.cache.BucketAdvisor.acquiredPrimaryLock(BucketAdvisor.java:1160)
> at
> org.apache.geode.internal.cache.BucketAdvisor.access$300(BucketAdvisor.java:77)
> at
> org.apache.geode.internal.cache.BucketAdvisor$VolunteeringDelegate.doVolunteerForPrimary(BucketAdvisor.java:2471)
> at
> org.apache.geode.internal.cache.BucketAdvisor$VolunteeringDelegate.lambda$consumeQueue$0(BucketAdvisor.java:2680)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> at
> org.apache.geode.distributed.internal.ClusterDistributionManager.runUntilShutdown(ClusterDistributionManager.java:959)
> at
> org.apache.geode.distributed.internal.ClusterDistributionManager.doWaitingThread(ClusterDistributionManager.java:849)
> at
> org.apache.geode.internal.logging.LoggingThreadFactory.lambda$newThread$0(LoggingThreadFactory.java:121)
> at java.lang.Thread.run(Thread.java:748)
> {noformat}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)