GitHub user ahgittin opened a pull request: https://github.com/apache/brooklyn-server/pull/565
Be truly immediate/non-blocking more often Builds on #480, really quite small once that is merged, tidies up many of the "immediate"-related annoyances. /cc @aledsage @grkvlt @neykov @sjcorbett You can merge this pull request into a Git repository by running: $ git pull https://github.com/ahgittin/brooklyn-server config-immediate-more Alternatively you can review and apply these changes as the patch at: https://github.com/apache/brooklyn-server/pull/565.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #565 ---- commit d7c60364e2e83fa6b9255504c515170e497eb2ef Author: Alex Heneveld <alex@alexs-macbook-pro.local> Date: 2016-12-06T15:50:18Z handle recursive task errors incl self-ref config address BROOKLYN-329 case (2), where a config key is defined as a function of itself detect the endless loop that results and fail with a good message also better handling in general of endless-loop task failures, including: * bail-out logic in Exceptions.collapse to prevent crazy long strings and traces * warning whenever active tasks passes N*1000 commit a6796829e89f4239a5480622abd1d166485c766c Author: Alex Heneveld <alex.henev...@cloudsoftcorp.com> Date: 2016-11-17T15:11:14Z flesh out test cases around non-blocking evaluation commit 4121554d8664ee11ed989428e0e84992267da634 Author: Alex Heneveld <alex@alexs-macbook-pro.local> Date: 2016-12-06T16:09:20Z add (failing) test re config loop and immediate evaluation commit 5324f8212aac0aee1deac9b47155e37b1120c78a Author: Alex Heneveld <alex@alexs-macbook-pro.local> Date: 2016-12-06T16:26:41Z better logging and reporting if no entity available for immediate eval commit faeeb1bdfc065b7e44554f45cca6a3f87074efb1 Author: Alex Heneveld <alex@alexs-macbook-pro.local> Date: 2016-12-06T22:15:10Z immediate execution runs in a fake tag allowing context to be evaluated most new immediate tests now passing, including a new test which detects recursive config values for immediate; except we still have: * cancellations of immediate execution goes too far, and cancels tasks which are set as values * task factories still not supported for evaluation commit f84d886337de242450097fec06ec62ccaf1fe807 Author: Alex Heneveld <alex@alexs-macbook-pro.local> Date: 2016-12-06T22:34:46Z solve problem with map eval where tasks are cancelled permanently sets non-transient if a task is requested for a value-resolver we might want to deprecate that altogether, instead use TaskFactory so we can cancel things don't think there will be much leaking because the ValueResolver isn't used for new tasks, just for tasks which are set as values -- but we need to keep an eye on that. such tasks should be cancelled when the entities are cleaned up. commit 49f0e225f8196c9d2314afe52cffbc1839cdfcf6 Author: Alex Heneveld <alex@alexs-macbook-pro.local> Date: 2016-12-06T22:45:14Z cleanup, and allow TaskFactory to be supplied as a config and other ValueResolver input the TF will create a task which will then be used for evaluation. much cleaner semantics than setting tasks as values: tasks evaluate once and remember their result, whereas task factory spawns a new task each time. furthermore, the former cannot be interrupted without making the value _never_ resolvable (which was the case prior to the previous commit) so it is left running if immediate eval is done, whereas the latter can be safely cancelled. commit 72eff85763db0a6c6b6d854af3834f5e1940f3d8 Author: Alex Heneveld <alex.henev...@cloudsoftcorp.com> Date: 2017-02-15T18:33:30Z Merge branch 'master' into config-self-reference-fix commit 3f3e3d67936e3059a48a0659d1e82c54b95ff7d7 Author: Alex Heneveld <alex.henev...@cloudsoftcorp.com> Date: 2017-02-15T18:58:30Z Merge branch 'master' into config-self-reference-fix commit 7476d3b5f830d80fdd872ccfd70c8f0f7bf98015 Author: Alex Heneveld <alex.henev...@cloudsoftcorp.com> Date: 2017-02-18T01:30:55Z add many of the code review comments commit b0733494ce0ef307235ff055bfb0f4815736e876 Author: Alex Heneveld <alex.henev...@cloudsoftcorp.com> Date: 2017-02-18T11:53:11Z tweak self-ref check strategy to make idempotent commit 0aa29efc6750575427628b025dd84dc8aa8020e6 Author: Alex Heneveld <alex.henev...@cloudsoftcorp.com> Date: 2017-02-18T14:12:12Z use a task so tag is always applied in a dedicated context so it doesn't need to be removed the previous attempt at idempotency could set the tag too broadly, e.g. when evaluating K1, then subsequently looking at a K2 that refers to K1, the latter would think it's recursed inside the former commit cd3d4864aa2a59a18f28997313ca07bc9185fd62 Author: Alex Heneveld <alex.henev...@cloudsoftcorp.com> Date: 2017-02-18T16:31:26Z ensure TaskFactory items evaluated immediately don't leak long-running tasks commit 99ccc0f6c8703e924c5fff5197bf1a0c6e39bc81 Author: Alex Heneveld <alex.henev...@cloudsoftcorp.com> Date: 2017-02-20T12:38:48Z more assertions for task cancellation commit 2e6f11fae83170f5f5dab8f39bf1a416412f685d Author: Alex Heneveld <alex.henev...@cloudsoftcorp.com> Date: 2017-02-20T12:41:07Z wrap immediate executions in an (entity) execution context commit 0d77dbc17235c9bfb833467fcb158ee3a69843eb Author: Alex Heneveld <alex.henev...@cloudsoftcorp.com> Date: 2017-02-20T14:39:06Z use new maybe assertions commit 3821e02c504382cb5a5a2411ddecda5b58b73136 Author: Alex Heneveld <alex.henev...@cloudsoftcorp.com> Date: 2017-02-20T15:48:46Z Switch more of the "immediate" / "non-blocking" calls to be truly non-blocking. Also updates tests. Mainly uses ImmediateSupplier and InterruptingImmediateSupplier for true non-blocking evaluation, with some other tricks used in other places. Some non-reliable calls may still fail, but most have been repaired, and the rest should be. (If the old semantics are _really_ needed you can resolve with a short wait.) Re-enables many of the tests disabled for https://issues.apache.org/jira/browse/BROOKLYN-272 ---- --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---