Github user ahgittin commented on the issue:
https://github.com/apache/brooklyn-server/pull/816
I believe we use `getImmediately` to resolve DSL expressions in config
which end up being `TaskFactory`; for `TaskFactory` we *should* be submitting
their tasks with immediate semantics: that was the main source of "leaks", in
that to validate them we want to evaluate them immediately if possible,
otherwise discard the tasks.
We could change the contract of `getImmediately` to take `TaskFactory`
items but that would break semantics. Instead all I've done I think is simply
be explicit about the pre-existing behaviour that tasks will be submitted and
might be rendered unusable if they are not immediate-friendly, which I think is
fine.
Good idea to log warn/deprecated if a config value is set to be a `Task`,
saying that `TaskFactory` or `Supplier` values should be supplied instead. (I
don't think that is done outwith tests.) We might also look at warning within
`getImmediately` if that is given a `Task`, to check the feasibility of
clearing up ambiguity there.
I will look to do that in #835 rather than make this bigger if that's okay
@aledsage .
---