Github user ahgittin commented on the pull request:
https://github.com/apache/brooklyn-server/pull/53#issuecomment-194940813
static caches are bad! :) the right impl i think would be to search
through known locations to look for locations with scope and store the vlan
id's on that. that would also allow us to resize to 0 then back out, and we'll
get a new vlan id. however that may be hard.
could we note that preferred implementation as a comment in the code?
however a more important problem is that the static cache prevents the vlan
id's to be persisted. if we restart brooklyn then scale out we will acquire a
new vlan id with this code. :( i think that does need to be fixed.
it could be fixed by switching away from the cache. however a simpler fix
could be that the first thread which acquires the semaphore before exiting
(without setting a vlan id) first does a query of machines in SL. if there are
some already there we just take their vlan id info and cache that. it won't be
perfect because vlan id *could* change if we rebooted brooklyn and the list of
vm's from SL came back in a different order but i think we could live with
that. also it means that we are able to provision in parallel much more often,
if there are any machines in SL, and machines in different apps will also go on
to the same vlan (not needed but nice).
---
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.
---