{"action":"created","issue":{"url":"https://api.github.com/repos/rock-core/tools-roby/issues/36","labels_url":"https://api.github.com/repos/rock-core/tools-roby/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/rock-core/tools-roby/issues/36/comments","events_url":"https://api.github.com/repos/rock-core/tools-roby/issues/36/events","html_url":"https://github.com/rock-core/tools-roby/issues/36","id":116151944,"number":36,"title":"Roby:ExecutionEngine garbages free plan events","user":{"login":"D-Alex","id":2762297,"avatar_url":"https://avatars.githubusercontent.com/u/2762297?v=3","gravatar_id":"","url":"https://api.github.com/users/D-Alex","html_url":"https://github.com/D-Alex","followers_url":"https://api.github.com/users/D-Alex/followers","following_url":"https://api.github.com/users/D-Alex/following{/other_user}","gists_url":"https://api.github.com/users/D-Alex/gists{/gist_id}","starred_url":"https://api.github.com/users/D-Alex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/D-Alex/subscriptions","organizations_url":"https://api.github.com/users/D-Alex/orgs","repos_url":"https://api.github.com/users/D-Alex/repos","events_url":"https://api.github.com/users/D-Alex/events{/privacy}","received_events_url":"https://api.github.com/users/D-Alex/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-11-10T17:02:50Z","updated_at":"2015-11-16T10:51:34Z","closed_at":"2015-11-16T00:04:20Z","body":"Use Case (Roby without syskit plugin).\r\nThe following task will never succeed because the AndGenerator Event is garbage collected right a way removing task and task2 from the AndGenerator object.\r\n\r\n    Robot.actions do \r\n      ... \r\n       def move(arg)\r\n          task = MyTask.new\r\n          task2 = MyTask2.new\r\n          (task | task2)\r\n       end\r\n    end\r\n       \r\nMy workaround is to remove https://github.com/rock-core/tools-roby/blob/master/lib/roby/execution_engine.rb#L1698 deleting all free events not belonging to a transaction. \r\n\r\nSome more debugging revealed that the AndGenerator event gets collected by discover_new_objects and added as free_event to the plan after calling add(object). Is this intended? Must all embedded events be added to the plan as free events if they are not TaskEvents? What would be a proper fix?\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/rock-core/tools-roby/issues/comments/156989361","html_url":"https://github.com/rock-core/tools-roby/issues/36#issuecomment-156989361","issue_url":"https://api.github.com/repos/rock-core/tools-roby/issues/36","id":156989361,"user":{"login":"doudou","id":292,"avatar_url":"https://avatars.githubusercontent.com/u/292?v=3","gravatar_id":"","url":"https://api.github.com/users/doudou","html_url":"https://github.com/doudou","followers_url":"https://api.github.com/users/doudou/followers","following_url":"https://api.github.com/users/doudou/following{/other_user}","gists_url":"https://api.github.com/users/doudou/gists{/gist_id}","starred_url":"https://api.github.com/users/doudou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doudou/subscriptions","organizations_url":"https://api.github.com/users/doudou/orgs","repos_url":"https://api.github.com/users/doudou/repos","events_url":"https://api.github.com/users/doudou/events{/privacy}","received_events_url":"https://api.github.com/users/doudou/received_events","type":"User","site_admin":false},"created_at":"2015-11-16T10:51:34Z","updated_at":"2015-11-16T10:51:34Z","body":"> is that an error if all tasks are pending?\r\n\r\nNo. It can happen if e.g. you create a plan that is waiting on an external event, and then decide to drop it because you don't need it anymore.\r\n\r\n> is that an error if a event is added which is not included in the set of useful_events\r\n\r\nUsefulness is a global property, adding task a local operation: most tasks and events are not useful when added. This will actually become the norm when I get the time to refactor the Roby graph code (something that is really really needed), because an object will have to be in a plan before it can be added to a relation graph.\r\n\r\nThe only place where such a check could be added is during transaction commit. I'm not sure it's that useful, though, since it would force every transaction-creation code to make sure they clean up before they commit (which would end up being something like running a garbage collector pass)"}}