Skip to content

Conversation

caguero
Copy link
Collaborator

@caguero caguero commented Sep 4, 2025

🦟 Bug fix

Fixes this issue.

This patch avoids a crash when the CreateMessage() function wasn't able to create a message. When using zenoh, we weren't checking whether the message was successfully created or not.

Note that CreateMessage() doesn't have to always create a message, there are situations where it's not possible to do. The most common case is when the publisher publishes a custom message and the subscriber doesn't have access to that message definition. This is what happens in the reported issue, gz topic echo shouldn't work (unless it has access to the .desc message files) but in any case it should not crash.

How to test it?

Compile the examples:

cd <jetty_ws>/src/gz-transport/example
mkdir build && cd build
make -j

In terminal 1:

./publisher_custom_msg

In terminal 2:

gz topic -e -t /foo

No output should appear on the terminal but nothing should crash.

Summary

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers
  • Was GenAI used to generate this PR? If so, make sure to add "Generated-by" to your commits. (See this policy for more info.)

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by and Generated-by messages.

Signed-off-by: Carlos Agüero <caguero@osrfoundation.org>
@github-project-automation github-project-automation bot moved this from Inbox to In review in Core development Sep 4, 2025
@caguero caguero merged commit 5681dec into gz-transport15 Sep 4, 2025
15 checks passed
@caguero caguero deleted the caguero_check_msg_creation branch September 4, 2025 21:31
@github-project-automation github-project-automation bot moved this from In review to Done in Core development Sep 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🪵 jetty Gazebo Jetty

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

gz-transport: Messages

2 participants