geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jinmeil...@apache.org
Subject [01/32] incubator-geode git commit: GEODE-1599: Array size allocation method was changed to prevent race condition in CopyOnWriteArray
Date Tue, 05 Jul 2016 23:15:24 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-1571 b37f43932 -> 8a26ac0d7


GEODE-1599: Array size allocation method was changed to prevent race condition in CopyOnWriteArray

	* toArray(new Statistics[statlist.size()]); was converted to toArray(new Statistics[0]);
	* This is done to avoid a race condition.
	* The size of the CopyOnWriteArray may increase after allocating the size for the array in
which the CopyOnWriteArray is to be placed


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/ec5578a2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/ec5578a2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/ec5578a2

Branch: refs/heads/feature/GEODE-1571
Commit: ec5578a22c75dbdf7ae698b805307915fcf763a0
Parents: 186a09a
Author: nabarun <nnag@pivotal.io>
Authored: Mon Jun 27 11:12:51 2016 -0700
Committer: nabarun <nnag@pivotal.io>
Committed: Thu Jun 30 15:07:29 2016 -0700

----------------------------------------------------------------------
 .../gemfire/distributed/internal/InternalDistributedSystem.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ec5578a2/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalDistributedSystem.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalDistributedSystem.java
b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalDistributedSystem.java
index a672127..14a4d53 100755
--- a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalDistributedSystem.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalDistributedSystem.java
@@ -1720,7 +1720,7 @@ public class InternalDistributedSystem
   @Override
   public final Statistics[] getStatistics() {
     List<Statistics> statsList = this.statsList;
-    return (Statistics[])statsList.toArray(new Statistics[statsList.size()]);
+    return (Statistics[])statsList.toArray(new Statistics[0]);
   }
   
   // StatisticsFactory methods


Mime
View raw message