Github user neykov commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/717#discussion_r33250131
--- Diff:
software/base/src/main/java/brooklyn/entity/basic/SoftwareProcessImpl.java ---
@@ -456,6 +456,9 @@ protected final void callStartHooks() {}
Object value = getConfig(k);
if (value instanceof Integer){
ports.add((Integer)value);
+ } else if
(PortRange.class.isAssignableFrom(value.getClass())) {
+ PortRange p = (PortRange)value;
+ if (p != null && !p.isEmpty())
ports.add(p.iterator().next());
--- End diff --
This won't work if there's a port collision, which will cause the
corresponding port attribute to be incremented until a free port is found. In
that case the entity will use the free port, but the firewall will open the
initial port instead. Mostly a problem for `SameServerEntity`, `localhost`
location. As you've copied the existing logic I am fine with keeping it as is,
but worth adding a comment.
There's identical logic in `SameServerDriverLifecycleEffectorTasks` so
better update it there as well.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---