Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed bug with updating vmm node avaiable memory

  • Loading branch information...
commit 5f9c2973d121d1f1b076e72586af7d1ef7c32b28 1 parent 7043fbc
@labisso labisso authored
View
3  service/service/java/source/src/org/globus/workspace/persistence/PersistenceAdapter.java
@@ -201,7 +201,8 @@ public void updateCursorPosition(long currentPosition)
boolean updateResourcepoolEntry(String hostname,
String pool,
String networks,
- Integer memory,
+ Integer memoryMax,
+ Integer memoryAvail,
Boolean active)
throws WorkspaceDatabaseException;
}
View
14 service/service/java/source/src/org/globus/workspace/persistence/PersistenceAdapterImpl.java
@@ -1848,7 +1848,8 @@ public void updateResourcepoolEntryAvailableMemory(String hostname, int newAvail
public boolean updateResourcepoolEntry(String hostname,
String pool,
String networks,
- Integer memory,
+ Integer memoryMax,
+ Integer memoryAvail,
Boolean active)
throws WorkspaceDatabaseException {
@@ -1860,7 +1861,7 @@ public boolean updateResourcepoolEntry(String hostname,
}
final StringBuilder sb = new StringBuilder();
- final List<Object> params = new ArrayList<Object>(4);
+ final List<Object> params = new ArrayList<Object>(5);
if (pool != null) {
appendUpdatePair(sb, "resourcepool");
params.add(pool);
@@ -1869,10 +1870,15 @@ public boolean updateResourcepoolEntry(String hostname,
appendUpdatePair(sb, "associations");
params.add(networks);
}
- if (memory != null) {
+ if (memoryMax != null) {
appendUpdatePair(sb, "maximum_memory");
- params.add(memory);
+ params.add(memoryMax);
}
+ if (memoryAvail != null) {
+ appendUpdatePair(sb, "available_memory");
+ params.add(memoryAvail);
+ }
+
if (active != null) {
appendUpdatePair(sb, "active");
params.add(active);
View
18 ...ervice/java/source/src/org/globus/workspace/scheduler/defaults/DefaultSlotManagement.java
@@ -559,8 +559,24 @@ public synchronized ResourcepoolEntry updateNode(
throws NodeInUseException, NodeNotFoundException {
try {
+
+ Integer availMemory = null;
+ if (memory != null) {
+ final ResourcepoolEntry entry = getNode(hostname);
+ if (entry == null) {
+ throw new NodeNotFoundException();
+ }
+
+ if (!entry.isVacant()) {
+ logger.info("Refusing to update VMM node "+ hostname+
+ " memory max while VMs are running");
+ throw new NodeInUseException();
+ }
+ availMemory = memory;
+ }
+
boolean updated = this.db.updateResourcepoolEntry(hostname,
- pool, networks, memory, active);
+ pool, networks, memory, availMemory, active);
if (!updated) {
throw new NodeNotFoundException();
}
Please sign in to comment.
Something went wrong with that request. Please try again.