Github user tbouron commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/916#discussion_r158266008
--- 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 --
I think throwing here is the right behaviour @aledsage: we cannot grow more
that the maximum size allowed. It also preserves backward compatibility.
However, the idea of growing until we reach the max size, regardless of
exceeding it is an interesting idea. Maybe this could be another effector, or
some parameter to the `resize` to allow it?
---