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

Move notification about ready for playback inside play_messages_from_… #832

Merged
merged 1 commit into from
Jul 30, 2021

Conversation

MichaelOrlov
Copy link
Contributor

@MichaelOrlov MichaelOrlov commented Jul 30, 2021

Move notification that player ready for playback inside play_messages_from_queue() after peeking pointer to the next message.
The rational is that moodycamel::ReaderWriterQueue::peek() is not allowed to be called from more than one thread concurrently.
Please see more details in #828 (comment)

Option with protecting Player::peek_next_message_from_queue() by mutex is highly undesirable since it would affect performance in case we would have messages recorded with high frequency and substantial amount of payload.

We are fine with current workaround since it will be only one thread accessing Player::peek_next_message_from_queue() by design.

…queue()

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
@MichaelOrlov MichaelOrlov self-assigned this Jul 30, 2021
@MichaelOrlov MichaelOrlov marked this pull request as ready for review July 30, 2021 19:09
@MichaelOrlov MichaelOrlov requested a review from a team as a code owner July 30, 2021 19:09
@MichaelOrlov MichaelOrlov requested review from zmichaels11, jhdcs, emersonknapp and Karsten1987 and removed request for a team July 30, 2021 19:09
Copy link
Contributor

@jhdcs jhdcs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not foresee any immediate issues from this change, and the comment seems fairly clear. Looks good to me.

@MichaelOrlov
Copy link
Contributor Author

MichaelOrlov commented Jul 30, 2021

Gist:
https://gist.githubusercontent.com/MichaelOrlov/fb184030a3a1b6a6d8eba0485919cb72/raw/91bbb7773423d0207a3daa09e4951bbceb9664e6/ros2.repos
BUILD args: --packages-up-to rosbag2_transport
TEST args: --packages-select rosbag2_transport
Job: nightly_linux_debug
nightly_linux_debug ran: https://ci.ros2.org/job/nightly_linux_debug/2007/
Build Status

@MichaelOrlov MichaelOrlov merged commit b2a402d into master Jul 30, 2021
@delete-merged-branch delete-merged-branch bot deleted the fix-for-concurrent-call-to-msg-queue-seek-api branch July 30, 2021 22:51
camm73 pushed a commit to camm73/rosbag2 that referenced this pull request Aug 6, 2021
…queue() (ros2#832)

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
Signed-off-by: Cameron Miller <cammlle@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test_play_next failed on nightly CI with an assertion
2 participants