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

[foxy backport] Derive and throw exception in spin_some spin_all for StaticSingleThreadedExecutor (#1220) #1229

Closed
wants to merge 2 commits into from

Conversation

brawner
Copy link
Contributor

@brawner brawner commented Jul 14, 2020

This backports just changes to the headers, not the unit test.

Signed-off-by: Stephen Brawner brawner@gmail.com

Signed-off-by: Stephen Brawner <brawner@gmail.com>
@brawner brawner requested a review from jacobperron July 14, 2020 17:09
Signed-off-by: Stephen Brawner <brawner@gmail.com>
@brawner
Copy link
Contributor Author

brawner commented Jul 14, 2020

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

@jacobperron
Copy link
Member

@brawner I think you need to also provide the foxy repos file for CI.

@jacobperron
Copy link
Member

I wasn't sure if this change was ABI compatible so I ran an ABI checker and it looks good 👍

@brawner
Copy link
Contributor Author

brawner commented Jul 15, 2020

Rerunning tests.

I wasn't sure if this change was ABI compatible so I ran an ABI checker and it looks good

Thanks! But I think that may because those implementations are header only. If the implementation eventually gets moved to the source file, do we have anything to worry about?

Also, this file wasn't actually being tested anywhere and not linked to. Would the ABI checker recognize it?

@jacobperron
Copy link
Member

I don't know the answer to either of your questions 😅

Maybe someone from @ros2/team can weigh in?

@brawner
Copy link
Contributor Author

brawner commented Jul 15, 2020

From what I can tell from: https://community.kde.org/Policies/Binary_Compatibility_Issues_With_C%2B%2B under section "Adding a reimplemented virtual function"

This will break ABI compatibility if anyone calls the derived function explicitly:

rclcpp::executors::StaticSingleThreadedExecutor executor;
executor.add_node(node);
executor.spin_some();

But wouldn't if they called the base class implementation:

rclcpp::Executor executor = rclcpp::executors::StaticSingleThreadedExecutor();
executor.add_node(node);
executor.spin_some();

Since the compiler will not include the vtable lookup in the first version.

As these functions do not currently work at all, this might be a potentially necessary breaking ABI change that can helps users understand why it broke.

@clalancette
Copy link
Contributor

Right, as far as I can tell, this will break ABI, because it will change the offsets into the derived object (as you correctly state above).

I'm on the fence about whether it is worth it to break ABI for this. On the "yes, let's break ABI" side, Foxy is only a month old, and so the number of users is probably fairly low (and thus the scope of the breakage is low). Further, there probably aren't very many users of StaticSingleThreadedExecutor. On the "no, let's not break ABI" side, the bar to break ABI is pretty high, and I'm not sure that on its own, this clears it. The problem doesn't seem severe enough to me to potentially break users (which, if they don't recompile, will break in incomprehensible ways too).

I'd lean towards "no, let's not break ABI, and just document the problem", but I could be persuaded otherwise. I'd like to hear more opinions.

@chapulina
Copy link
Contributor

I often refer to this guide from KDE when it comes to ABI. They have some tips to workaround adding a reimplemented virtual function, which could be done for Foxy, then the correct thing can be done for Galactic.

I'd lean towards "no, let's not break ABI

+1

@jacobperron
Copy link
Member

I'm also leaning towards not breaking API and documenting the issue. We should add it to the list of known issues for Foxy.

@brawner
Copy link
Contributor Author

brawner commented Jul 15, 2020

For reference, this is the open rclcpp issue. #1219

I'll make a PR for submitting it to known issues.

@brawner
Copy link
Contributor Author

brawner commented Oct 6, 2020

Closing in favor of #1385

@brawner brawner closed this Oct 6, 2020
@brawner brawner deleted the brawner/backport-foxy-1220 branch October 6, 2020 22:00
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.

4 participants