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

Don't crash when type definition cannot be found #1350

Merged
merged 2 commits into from
May 25, 2023

Conversation

emersonknapp
Copy link
Collaborator

Fail gracefully to an empty type definition, if the name of the type was not fully understood by the local message definition source file search.

This is a fix to the crashing aspect of #1336 and #1286, which will downgrade the issue to "incomplete information in bag", which we have decided is a better outcome than a crash.

Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
@emersonknapp emersonknapp requested a review from a team as a code owner May 24, 2023 21:07
@emersonknapp emersonknapp requested review from MichaelOrlov, jhdcs and james-rms and removed request for a team May 24, 2023 21:07
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Copy link
Contributor

@MichaelOrlov MichaelOrlov left a comment

Choose a reason for hiding this comment

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

LGTM.

@emersonknapp
Copy link
Collaborator Author

Gist: https://gist.githubusercontent.com/emersonknapp/0765b85b4298c80c570196adb92faa35/raw/cb4ebfa636908f3e5e1d6d4ad8f5a5d3d1c135da/ros2.repos
BUILD args: --packages-above-and-dependencies rosbag2_cpp
TEST args: --packages-above rosbag2_cpp
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/12117

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

@emersonknapp emersonknapp merged commit dae4660 into rolling May 25, 2023
@delete-merged-branch delete-merged-branch bot deleted the emersonknapp/bad-typename-empty-spec branch May 25, 2023 22:54
@emersonknapp
Copy link
Collaborator Author

@Mergifyio backport iron

@mergify
Copy link

mergify bot commented May 25, 2023

backport iron

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request May 25, 2023
* Don't fail when type definition cannot be found

Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
(cherry picked from commit dae4660)
MichaelOrlov pushed a commit that referenced this pull request May 26, 2023
* Don't fail when type definition cannot be found

Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
(cherry picked from commit dae4660)

Co-authored-by: Emerson Knapp <537409+emersonknapp@users.noreply.github.com>
@russkel
Copy link

russkel commented Jun 13, 2023

Given that humble is going to be around for a while as LTS, should this also be backported?

@emersonknapp
Copy link
Collaborator Author

@russkel Good instincts! It would be a yes, except the feature set LocalMessageDefinitionSource that finds message definitions to add to bagfiles doesn't exist yet in Humble, so it doesn't have that crash case.

@russkel
Copy link

russkel commented Jun 13, 2023

@russkel Good instincts! It would be a yes, except the feature set LocalMessageDefinitionSource that finds message definitions to add to bagfiles doesn't exist yet in Humble, so it doesn't have that crash case.

How unfortunate. Presumably that's not a trivial merge then?

@emersonknapp
Copy link
Collaborator Author

emersonknapp commented Jun 14, 2023

Typically significant API changes (and therefore large new features) are very hard to backport, mostly we'll only do minor feature extensions and bugfixes.

I did just remember while looking at it, that Humble does have the MessageDefinitionCache, but it was part of the rosbag2_storage_mcap plugin (it was later moved into the rosbag2_cpp core where it can pass defintions to any storage implementation). That being the case, I do believe that Humble actually does have this crash case for MCAP users, so I can do a manual backport of the equivalent fix.

@ros-discourse
Copy link

This pull request has been mentioned on ROS Discourse. There might be relevant details there:

https://discourse.ros.org/t/ros-2-tsc-meeting-minutes-2023-06-15/32038/1

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.

5 participants