Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise std::future_error: Promise already satisfied #141

Closed
vinnamkim opened this issue Jul 31, 2019 · 5 comments · Fixed by #143
Closed

Raise std::future_error: Promise already satisfied #141

vinnamkim opened this issue Jul 31, 2019 · 5 comments · Fixed by #143
Assignees
Labels
bug Something isn't working

Comments

@vinnamkim
Copy link
Contributor

Bug report

Required Info:

  • Operating System:
    Ubuntu 18.04
  • Installation type:
    source
  • Version or commit hash:
    e29db0a
  • DDS implementation:
    Fast-RTPS
  • Client library (if applicable):
    rclcpp, nav2_amcl

Steps to reproduce issue

Launching nav2_bringup's nav2_simulation_launch.py and waiting some minutes.

Expected behavior

Nothing happen

Actual behavior

Exception(what(): std::future_error: Promise already satisfied) is raised at the following code.

promise->set_exception(

Additional information

It seems Buffer::timerCallback is called

promise->set_exception(

after cb_handle is called.
auto cb_handle = addTransformableCallback([&, promise, callback, future](

@vinnamkim
Copy link
Contributor Author

Related to ros-navigation/navigation2#967

@mkhansenbot
Copy link

@jacobperron @tfoote - can someone prioritize looking into this, it is causing failures in navigation2 about 50-60% of the time

@jacobperron jacobperron self-assigned this Aug 5, 2019
@jacobperron jacobperron added the bug Something isn't working label Aug 5, 2019
@jacobperron
Copy link
Member

I also ran into this myself. Working on a fix now.

jacobperron added a commit that referenced this issue Aug 6, 2019
The timer-request handle map is used to check if the promise to the user has already been set.
For the transformable request callback, we loop over the values of the map to check if the request is still valid.
Alternatively, we could implement a bi-directional map for efficiency, but I don't expect the number of entries in
the timer-request map to be large so it seems like a pre-mature optimization.

Fixes #141

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
@jacobperron
Copy link
Member

This bug was introduced in #121.
Fixed in #143.

@jacobperron
Copy link
Member

@vinnamkim @mkhansen-intel Can someone confirm that applying #143 resolves the issue for you?

jacobperron added a commit that referenced this issue Aug 6, 2019
* Add test for race in tf2_ros::Buffer

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Fix race between timeout and transform ready callback

The timer-request handle map is used to check if the promise to the user has already been set.
For the transformable request callback, we loop over the values of the map to check if the request is still valid.
Alternatively, we could implement a bi-directional map for efficiency, but I don't expect the number of entries in
the timer-request map to be large so it seems like a pre-mature optimization.

Fixes #141

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants