You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by mb...@apache.org on 2015/11/16 21:15:19 UTC
[1/2] incubator-geode git commit: GEODE-151: Updates from review
Repository: incubator-geode
Updated Branches:
refs/heads/feature/GEODE-151 aab056851 -> d8ed5d76e
GEODE-151: Updates from review
Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/d8ed5d76
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/d8ed5d76
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/d8ed5d76
Branch: refs/heads/feature/GEODE-151
Commit: d8ed5d76e4adc060eab91a1ca36d9877f0d68103
Parents: d6c58e8
Author: Mark Bretl <mb...@pivotal.io>
Authored: Mon Nov 16 12:05:07 2015 -0800
Committer: Mark Bretl <mb...@pivotal.io>
Committed: Mon Nov 16 12:12:59 2015 -0800
----------------------------------------------------------------------
gemfire-core/build.gradle | 21 ++++-----------------
1 file changed, 4 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d8ed5d76/gemfire-core/build.gradle
----------------------------------------------------------------------
diff --git a/gemfire-core/build.gradle b/gemfire-core/build.gradle
index ad1fa22..f03066f 100755
--- a/gemfire-core/build.gradle
+++ b/gemfire-core/build.gradle
@@ -100,31 +100,18 @@ task createVersionPropertiesFile {
doLast {
- ext.isGitWorkspace = true
try {
- def grgit = org.ajoberstar.grgit.Grgit.open()
- //def grgit = org.ajoberstar.grgit.Grgit.open(dir: 'asdf')
- } catch (Exception e) {
- logger.warn( '***** Unable to find Git workspace *****' )
- logger.warn( '***** Using default version information *****' )
- isGitWorkspace = false
- }
-
- if ( ext.isGitWorkspace ) {
+ def grgit = org.ajoberstar.grgit.Grgit.open()
ext.branch = grgit.branch.getCurrent().name
ext.commitId = grgit.head().id
ext.sourceDate = grgit.head().getDate().format('yyyy-MM-dd HH:mm:ss Z')
- logger.info( '***** Current Branch: ' + ext.branch + ' ******' )
- logger.info( '***** Current ID: ' + ext.commitId + ' ******' )
- logger.info( '***** Current Date: ' + ext.sourceDate + ' ******' )
- }
- else {
- // Not in SCM workspace, use default values
+ grgit.close()
+ } catch (Exception e) {
+ logger.warn( '***** Unable to find Git workspace. Using default version information *****' )
ext.branch = 'UNKNOWN'
ext.commitId = 'UNKNOWN'
ext.sourceDate = new Date().format('yyyy-MM-dd HH:mm:ss Z')
}
- grgit.close()
ext.osArch = System.getProperty('os.arch')
ext.osName = System.getProperty('os.name')
[2/2] incubator-geode git commit: GEODE-542: Send a function response
after a CancelException
Posted by mb...@apache.org.
GEODE-542: Send a function response after a CancelException
There was a catch clause of a CancelException that was causing us not to
reply to a function call if a CacheClosedException was thrown from the
function. That caused as hang waiting for replies.
Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/d6c58e86
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/d6c58e86
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/d6c58e86
Branch: refs/heads/feature/GEODE-151
Commit: d6c58e86a2abdb1670b02e4ac8089edb894f8f7c
Parents: aab0568
Author: Dan Smith <up...@apache.org>
Authored: Wed Nov 11 12:24:16 2015 -0800
Committer: Mark Bretl <mb...@pivotal.io>
Committed: Mon Nov 16 12:12:59 2015 -0800
----------------------------------------------------------------------
.../cache/MemberFunctionStreamingMessage.java | 9 ++--
.../MemberFunctionExecutionDUnitTest.java | 49 ++++++++++++++++++++
2 files changed, 54 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d6c58e86/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/MemberFunctionStreamingMessage.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/MemberFunctionStreamingMessage.java b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/MemberFunctionStreamingMessage.java
index 9ea6f28..b3bdc85 100755
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/MemberFunctionStreamingMessage.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/MemberFunctionStreamingMessage.java
@@ -32,6 +32,7 @@ import com.gemstone.gemfire.cache.CacheException;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.execute.Function;
import com.gemstone.gemfire.cache.execute.FunctionException;
+import com.gemstone.gemfire.cache.execute.FunctionInvocationTargetException;
import com.gemstone.gemfire.cache.execute.FunctionService;
import com.gemstone.gemfire.cache.execute.ResultSender;
import com.gemstone.gemfire.cache.query.QueryException;
@@ -213,10 +214,10 @@ public class MemberFunctionStreamingMessage extends DistributionMessage implemen
// bug 37026: this is too noisy...
// throw new CacheClosedException("remote system shutting down");
// thr = se; cache is closed, no point trying to send a reply
- thr = null;
- if (logger.isDebugEnabled()) {
- logger.debug("shutdown caught, abandoning message: {}",exception.getMessage(), exception);
- }
+ thr = new FunctionInvocationTargetException(exception);
+ stats.endFunctionExecutionWithException(this.functionObject.hasResult());
+ rex = new ReplyException(thr);
+ replyWithException(dm, rex);
}
catch (Exception exception) {
if (logger.isDebugEnabled()) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d6c58e86/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MemberFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MemberFunctionExecutionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MemberFunctionExecutionDUnitTest.java
index 129cd18..4b8f009 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MemberFunctionExecutionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MemberFunctionExecutionDUnitTest.java
@@ -25,12 +25,16 @@ import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
+import java.util.concurrent.TimeUnit;
+import com.gemstone.gemfire.cache.CacheClosedException;
+import com.gemstone.gemfire.cache.CacheFactory;
import com.gemstone.gemfire.cache.execute.Execution;
import com.gemstone.gemfire.cache.execute.Function;
import com.gemstone.gemfire.cache.execute.FunctionAdapter;
import com.gemstone.gemfire.cache.execute.FunctionContext;
import com.gemstone.gemfire.cache.execute.FunctionException;
+import com.gemstone.gemfire.cache.execute.FunctionInvocationTargetException;
import com.gemstone.gemfire.cache.execute.FunctionService;
import com.gemstone.gemfire.cache.execute.ResultCollector;
import com.gemstone.gemfire.cache30.CacheTestCase;
@@ -46,6 +50,8 @@ import com.gemstone.gemfire.internal.cache.functions.TestFunction;
import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
import dunit.Host;
+import dunit.SerializableCallable;
+import dunit.SerializableRunnable;
import dunit.VM;
public class MemberFunctionExecutionDUnitTest extends CacheTestCase {
@@ -300,6 +306,49 @@ public class MemberFunctionExecutionDUnitTest extends CacheTestCase {
member1.invoke(MemberFunctionExecutionDUnitTest.class, "bug41118");
}
+ public void testOnMembersWithoutCache()
+ throws Exception {
+ DistributedMember member1Id = (DistributedMember) member1.invoke(new SerializableCallable() {
+
+ @Override
+ public Object call() {
+ disconnectFromDS();
+ return getSystem().getDistributedMember();
+ }
+ });
+
+ member2.invoke(new SerializableRunnable() {
+
+ @Override
+ public void run() {
+ getSystem();
+ ResultCollector<?, ?> rc = FunctionService.onMember(member1Id).execute(new FunctionAdapter() {
+
+ @Override
+ public String getId() {
+ return getClass().getName();
+ }
+
+ @Override
+ public void execute(FunctionContext context) {
+ //This will throw an exception because the cache is not yet created.
+ CacheFactory.getAnyInstance();
+ }
+ });
+
+ try {
+ rc.getResult(30, TimeUnit.SECONDS);
+ fail("Should have seen an exception");
+ } catch (Exception e) {
+ if(!(e.getCause() instanceof FunctionInvocationTargetException)) {
+ fail("failed", e);
+ }
+ }
+
+ }
+ });
+ }
+
public static void bug41118(){
ds = new MemberFunctionExecutionDUnitTest("temp").getSystem();
assertNotNull(ds);