This repository was archived by the owner on May 31, 2025. It is now read-only.
Fix race condition that lead to miss first message#1054
Closed
kamibo wants to merge 3 commits intoros:indigo-develfrom
Closed
Fix race condition that lead to miss first message#1054kamibo wants to merge 3 commits intoros:indigo-develfrom
kamibo wants to merge 3 commits intoros:indigo-develfrom
Conversation
Callback queue waits for callback from "callOne" method. When internal queue is not empty this last method succeeded even if id info mapping does not contains related callback's id. In this case, first callback (for one id) is never called since "addCallback" method first push callback into internal queue and *then* set info mapping. So id info mapping has to be set before push callback into internal queue. Otherwise first message could be ignored.
Member
Member
Member
|
@kamibo I've created #1058 which is just a rebase of this branch on top of @dirk-thomas do you need a PR for Kinetic as well or you'll back/forward port it yourself? |
Author
|
Thanks @esteve it's perfect ! |
Added test for addCallback race condition
Member
|
Closing this in favor of #1058. The patch will be considered for backporting into older distros from the |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Callback queue waits for callback from "callOne" method.
When internal queue is not empty this last method succeeded even if id
info mapping does not contains related callback's id.
In this case, first callback (for one id) is never called since
"addCallback" method first push callback into internal queue and then
set info mapping.
So id info mapping has to be set before push callback into interal
queue. Otherwise first message could be ignored.
Attached file highlights this issue.
ros_callback_queue_bug.cpp.zip