Fix Executor not executing tasks if there are no ready entities in the wait set#272
Merged
jacobperron merged 2 commits intomasterfrom Feb 11, 2019
Merged
Fix Executor not executing tasks if there are no ready entities in the wait set#272jacobperron merged 2 commits intomasterfrom
jacobperron merged 2 commits intomasterfrom
Conversation
…e wait set If a task is created, then trigger the Executors guard condition. This will wake any blocking call to `rcl_wait()`. In this scenario, no work is yielded, so we also have to move the check for 'in-progress' tasks into the wait loop. Added a unit test to reproduce the issue. This resolves an issue in some cases where the result response from the action server is never processed, therefore never reaching the action client. Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Merged
sloretz
reviewed
Feb 11, 2019
Contributor
sloretz
left a comment
There was a problem hiding this comment.
Changes to the executor LGTM
| return 'Sentinel Result' | ||
|
|
||
| # Create a task | ||
| future = executor.create_task(func) |
Contributor
There was a problem hiding this comment.
I think there might be a race where this test could have a false negative if spin_until_task_done has not reached the while loop in _wait_for_ready_callbacks prior to this task being created.
Member
Author
There was a problem hiding this comment.
Yeah, I think you're right. I'm not sure how to avoid it, but it can be mitigated by sleeping for a short time before creating the task.
* Fix logic bug in test * Mitigate race in test Signed-off-by: Jacob Perron <jacob@openrobotics.org>
sloretz
approved these changes
Feb 11, 2019
Contributor
10 tasks
jacobperron
added a commit
that referenced
this pull request
Mar 7, 2019
…e wait set (#272) If a task is created, then trigger the Executors guard condition. This will wake any blocking call to `rcl_wait()`. In this scenario, no work is yielded, so we also have to move the check for 'in-progress' tasks into the wait loop. Added a unit test to reproduce the issue. This resolves an issue in some cases where the result response from the action server is never processed, therefore never reaching the action client. Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Merged
nuclearsandwich
pushed a commit
that referenced
this pull request
Mar 10, 2019
* Add Action Client (#262) * Add rclpy_action module With functions for creating and destroying action clients. * Implement action client * Move common conversion function and typedefs to shared header file (impl/common.h) * Add tests using mock action server * Add action module for aggregating action related submodules * Extend Waitable API so executors are aware of Futures * Move check_for_type_support() to its own module Signed-off-by: Jacob Perron <jacob@openrobotics.org> * Fix Executor not executing tasks if there are no ready entities in the wait set (#272) If a task is created, then trigger the Executors guard condition. This will wake any blocking call to `rcl_wait()`. In this scenario, no work is yielded, so we also have to move the check for 'in-progress' tasks into the wait loop. Added a unit test to reproduce the issue. This resolves an issue in some cases where the result response from the action server is never processed, therefore never reaching the action client. Signed-off-by: Jacob Perron <jacob@openrobotics.org> * Fix Node's reference to executor (#275) Previously, if a `Node` was added to an `Executor` using the executors `add_node` method, then nodes `executor` property would return `None`. Signed-off-by: Jacob Perron <jacob@openrobotics.org> * Abstract type conversions into functions (#269) * Abstract type conversions into functions This helps with readability and maintainability. Also eliminated use of assertions during conversions, defering to exceptions. * Move common C functions to a shared library 'rclpy_common' Signed-off-by: Jacob Perron <jacob@openrobotics.org> * Add ActionServer (#270) * Add Action server functions to extension module * Separated service related macros into separate request and response calls * Add server goal handle functions to extension module * Update Action extension module to use conversion functions * Add implementation of Python ActionServer * Handles goal and cancel requests, responds, and calls user-defined functions for executing goals. * Handle result requests * Handle expired goals * Publish goal status array and feedback * Add `handle_accepted_callback` to ActionServer Upon accepting a goal, the provided `handle_accepted_callback` is called with a reference to the goal handle. The user can then decide to execute the goal or defer. If `handle_accepted_callback` is not provided, then the default behavior is to execute the goal handle immediately. Signed-off-by: Jacob Perron <jacob@openrobotics.org> * Enable test using MultiThreadedExecutor (#280) Signed-off-by: Jacob Perron <jacob@openrobotics.org> * Guard against failed take when taking action messages (#281) Some middlewares (e.g. Connext and OpenSplice) send invalid messages to indicate an instance has been disposed which results in a 'failed take'. Signed-off-by: Jacob Perron <jacob@openrobotics.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If a task is created, then trigger the Executors guard condition. This will wake any blocking call to
rcl_wait().In this scenario, no work is yielded, so we also have to move the check for 'in-progress' tasks into the wait loop.
Added a unit test to reproduce the issue.
This resolves an issue in some cases where the result response from the action server is never processed, therefore never reaching the action client.