Dan Smith created GEODE-542: ------------------------------- Summary: Race in FunctionService.onMembers can result in hang during member startup Key: GEODE-542 URL: https://issues.apache.org/jira/browse/GEODE-542 Project: Geode Issue Type: Bug Reporter: Dan Smith
I hit this while doing some internal tests of FunctionService. I have a function that calls CacheFactory.getAnyInstance(). I was seeing that occasionally, my function would never see a reply while a member was starting up. Turning on debug logging, I found this is the logs {noformat} [fine 2015/10/28 17:15:41.903 PDT clientgemfire2_gluon_2055 <Function Execution Processor2> tid=0x37] shutdown caught, abandoning message: A cache has not yet been created. com.gemstone.gemfire.cache.CacheClosedException: A cache has not yet been created. at com.gemstone.gemfire.cache.CacheFactory.getAnyInstance(CacheFactory.java:292) at com.gemstone.gemfire.internal.cache.execute.util.RollbackFunction.execute(RollbackFunction.java:82) at com.gemstone.gemfire.internal.cache.MemberFunctionStreamingMessage.process(MemberFunctionStreamingMessage.java:194) at com.gemstone.gemfire.distributed.internal.DistributionMessage.scheduleAction(DistributionMessage.java:380) at com.gemstone.gemfire.distributed.internal.DistributionMessage$1.run(DistributionMessage.java:451) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at com.gemstone.gemfire.distributed.internal.DistributionManager.runUntilShutdown(DistributionManager.java:701) at com.gemstone.gemfire.distributed.internal.DistributionManager$9$1.run(DistributionManager.java:1158) at java.lang.Thread.run(Thread.java:745) {noformat} This seems wrong, because by not replying to the function the caller then can hang. I think this code was intended for use during shutdown, but it also gets hit during startup because members are available to process functions before the cache is created. That in itself is perhaps problematic. -- This message was sent by Atlassian JIRA (v6.3.4#6332)