Skip to content

ConsumeQueue decorator node returns incorrect status with async action node and empty queue #621

Closed
@AnkitSaini

Description

@AnkitSaini

Issue - We are seeing that the ConsumeQueue returns SUCCESS when it should return failure

Description - In case the ConsumeQueue decorator node is part of a tree that has Async action node the events where SUCCESS instead of FAILURE is returned can look like this -

  1. Inside while(!items.empty()) last item is popped
  2. child_node_ is ticked
  3. child_state is RUNNING hence RUNNING is returned from ConsumeQueue::tick()
  4. On next tick ConsumeQueue::tick() is called
  5. running_child_ was true from the previous tick
  6. State of child_node_ is checked and let's say it returns FAILURE
  7. haltChild() gets called and the logic continues on <---- THIS IS WHERE THE ISSUE IS
  8. while(!items.empty()) is not entered since queue is empty
  9. SUCCESS is returned at the bottom

A potential solution is to move reading the InputPort queue at the top. In case running_child_ is true followed by child_state_ is not RUNNING and queue->items.empty() is true, child_state_ should be returned after calling haltChild()

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions