changes to fix Issue 336: asterix build tests hang
diff --git a/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java b/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java
index 0dbf6d4..299c43c 100644
--- a/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java
+++ b/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java
@@ -231,7 +231,7 @@
List<CompilationUnit> cUnits = tcCtx.getTestCase().getCompilationUnit();
for (CompilationUnit cUnit : cUnits) {
- LOGGER.info("[TEST]: " + tcCtx.getTestCase().getFilePath() + "/" + cUnit.getName());
+ LOGGER.severe("[TEST]: " + tcCtx.getTestCase().getFilePath() + "/" + cUnit.getName());
testFileCtxs = tcCtx.getTestFiles(cUnit);
expectedResultFileCtxs = tcCtx.getExpectedResultFiles(cUnit);
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/EntityInfoManager.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/EntityInfoManager.java
index b8820c4..d9df1d7 100644
--- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/EntityInfoManager.java
+++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/EntityInfoManager.java
@@ -164,6 +164,7 @@
allocChild = pArray.size() - 1;
}
}
+
occupiedSlots++;
return pArray.get(allocChild).allocate() + allocChild * ChildEntityInfoArrayManager.NUM_OF_SLOTS;
}
@@ -235,40 +236,54 @@
int size = pArray.size();
int maxDecreaseCount = size / 2;
ChildEntityInfoArrayManager child;
- for (i = size - 1; i >= 0; i--) {
- child = pArray.get(i);
- if (child.isEmpty() || child.isDeinitialized()) {
- if (bContiguous) {
- pArray.remove(i);
- if (++decreaseCount == maxDecreaseCount) {
- break;
- }
- } else {
- bContiguous = false;
- if (child.isEmpty()) {
- child.deinitialize();
- if (++decreaseCount == maxDecreaseCount) {
- break;
- }
- }
- }
- } else {
- bContiguous = false;
+
+ for (i = 0; i < size; i++) {
+ if (pArray.get(i).isDeinitialized()) {
+ decreaseCount++;
}
}
- //reset allocChild when the child is removed or deinitialized.
- size = pArray.size();
- if (allocChild >= size || pArray.get(allocChild).isDeinitialized()) {
- //set allocChild to any initialized one.
- //It is guaranteed that there is at least one initialized child.
- for (i = 0; i < size; i++) {
- if (!pArray.get(i).isDeinitialized()) {
- allocChild = i;
- break;
+ if (decreaseCount < maxDecreaseCount) {
+
+ for (i = size - 1; i >= 0; i--) {
+ child = pArray.get(i);
+ if (child.isEmpty() || child.isDeinitialized()) {
+ if (bContiguous) {
+ pArray.remove(i);
+ if (child.isEmpty()) {
+ if (++decreaseCount == maxDecreaseCount) {
+ break;
+ }
+ }
+ } else {
+ bContiguous = false;
+ if (child.isEmpty()) {
+ child.deinitialize();
+ if (++decreaseCount == maxDecreaseCount) {
+ break;
+ }
+ }
+ }
+ } else {
+ bContiguous = false;
+ }
+ }
+
+ //reset allocChild when the child is removed or deinitialized.
+ size = pArray.size();
+ if (allocChild >= size || pArray.get(allocChild).isDeinitialized()) {
+ //set allocChild to any initialized one.
+ //It is guaranteed that there is at least one initialized child.
+ for (i = 0; i < size; i++) {
+ if (!pArray.get(i).isDeinitialized()) {
+ allocChild = i;
+ break;
+ }
}
}
}
+
+ isShrinkTimerOn = false;
}
public String prettyPrint() {
@@ -538,7 +553,7 @@
freeSlotNum = getNextFreeSlot(currentSlot);
occupiedSlots++;
if (LockManager.IS_DEBUG_MODE) {
- System.out.println(Thread.currentThread().getName()+" entity allocate: "+currentSlot);
+ System.out.println(Thread.currentThread().getName() + " entity allocate: " + currentSlot);
}
return currentSlot;
}
@@ -548,7 +563,7 @@
freeSlotNum = slotNum;
occupiedSlots--;
if (LockManager.IS_DEBUG_MODE) {
- System.out.println(Thread.currentThread().getName()+" entity deallocate: "+slotNum);
+ System.out.println(Thread.currentThread().getName() + " entity deallocate: " + slotNum);
}
}
diff --git a/pom.xml b/pom.xml
index 2d0922f..b424195 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,8 +7,8 @@
<packaging>pom</packaging>
<properties>
- <algebricks.version>0.2.4</algebricks.version>
- <hyracks.version>0.2.4</hyracks.version>
+ <algebricks.version>0.2.5-SNAPSHOT</algebricks.version>
+ <hyracks.version>0.2.5-SNAPSHOT</hyracks.version>
</properties>
<build>