Skip to content
This repository has been archived by the owner on Mar 5, 2022. It is now read-only.

Repeating tasks never exit #3

Open
josephmjoy opened this issue Feb 1, 2017 · 5 comments
Open

Repeating tasks never exit #3

josephmjoy opened this issue Feb 1, 2017 · 5 comments
Labels

Comments

@josephmjoy
Copy link

There is currently no task cancellation policy. For example, RepeatingTask.run method should return when the robot is disabled and/or switches out of the current mode (autonomous/teleop). Currently it never returns (has a while(true)). The iterator logic thread (collection thread) will never exit - will just be stuck waiting for a yield that never returns. It's not clean and it will leak threads each time there is a mode switch (when a new taskRunner instance is created, leaving the old one still hanging around stuck in some Task's yield call.) Suggestion: cancel task, and yield code should throw an exception. This support may already be there in the underlying Generator framework -need to investigate.

@sylvia43
Copy link
Contributor

sylvia43 commented Feb 2, 2017

Oh you're right-- good catch.

@PrecociouslyDigital
Copy link
Contributor

Who's gonna take care of this?

@josephmjoy
Copy link
Author

josephmjoy commented Feb 2, 2017

Note that it is not a "must-fix" for the competition.

@sylvia43
Copy link
Contributor

sylvia43 commented Feb 2, 2017

That's what I was going to say too. The dangling yielding threads won't accumulate enough over the powered on time of the roborio to do anything.

@PrecociouslyDigital
Copy link
Contributor

PrecociouslyDigital commented Feb 4, 2017 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants