Github user aledsage commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/916#discussion_r157902790
--- Diff:
core/src/main/java/org/apache/brooklyn/entity/group/DynamicClusterImpl.java ---
@@ -799,6 +795,14 @@ protected Entity replaceMember(Entity member,
@Nullable Location memberLoc, Map<
/** <strong>Note</strong> for sub-classes; this method can be called
while synchronized on {@link #mutex}. */
protected Collection<Entity> grow(int delta) {
Preconditions.checkArgument(delta > 0, "Must call grow with
positive delta.");
+ Integer maxSize = config().get(MAX_SIZE);
+ if (maxSize != null) {
+ final int desiredSize = getCurrentSize() + delta;
+ if (desiredSize > maxSize) {
+ throw new Resizable.InsufficientCapacityException(
--- End diff --
Should we throw if we'd be willing to grow a bit? e.g. if we're current
size 1 and asked to resize by delta of 10, but max size is 10 then should we
resize to 10 or should we fail? I think we should only fail if
`getCurrentSize() == maxSize`
---