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

Remove MANUAL_BY_NODE liveliness API #227

Merged
merged 9 commits into from May 12, 2020

Conversation

ivanpauno
Copy link
Member

It was agreed in the discussion here, that we were going to remove MANUAL_BY_NODE related liveliness API.

It would be great to actually do it before Foxy release, as it doesn't have more sense after the Participant/Context change.

Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
@ivanpauno
Copy link
Member Author

@wjwwood @jacobperron can you review this and the connected PRs?

I will then add a note to Foxy release notes, and update tutorials/design docs.

@rotu
Copy link

rotu commented May 7, 2020

@ivanpauno
Copy link
Member Author

This is not yet deprecated. Shouldn't we be deprecating instead?

https://index.ros.org/doc/ros2/Contributing/Developer-Guide/#deprecation-strategy
https://semver.org/#how-should-i-handle-deprecating-functionality

No, I think it's not going to be deprecated, but directly removed.

The reasons are two:

  • It isn't working as it was intended to work.
  • It's rarely used, so it won't affect much users.

@wjwwood
Copy link
Member

wjwwood commented May 7, 2020

I'll defer to @ivanpauno on this, as he has the most context, but my understanding is that the move to one participant per context makes this feature impossible to have working in a way that makes sense. So, it would not satisfy the first conditional of the linked policy, "where possible". But maybe my interpretation is wrong.

@wjwwood
Copy link
Member

wjwwood commented May 7, 2020

@ivanpauno this is way past the API freeze date though, I think we need approval from several people to make this change at this point...

Copy link
Member

@wjwwood wjwwood left a comment

Choose a reason for hiding this comment

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

lgtm, though changing the API at this point should be reviewed and acknowledged by several maintainers and should be announced separately, imo.

@rotu
Copy link

rotu commented May 7, 2020

I'll defer to @ivanpauno on this, as he has the most context, but my understanding is that the move to one participant per context makes this feature impossible to have working in a way that makes sense. So, it would not satisfy the first conditional of the linked policy, "where possible". But maybe my interpretation is wrong.

That seems to be a reason for deprecating it! Deprecate it and stub out the implementations if necessary. But don't introduce binary incompatibility just for the heck of it.

This is not yet deprecated. Shouldn't we be deprecating instead?
https://index.ros.org/doc/ros2/Contributing/Developer-Guide/#deprecation-strategy
https://semver.org/#how-should-i-handle-deprecating-functionality

No, I think it's not going to be deprecated, but directly removed.

The reasons are two:

  • It isn't working as it was intended to work.

That's a great reason to deprecate and gently redirect users.

  • It's rarely used, so it won't affect much users.

That's not even a consideration of either our developer guidelines nor SemVer

.I looked into this because I got pushback from @clalancette and @sloretz on a completely unused API function ros2/kdl_parser#7 (comment), who both felt it was incorrect to remove a function without first deprecating. We should enforce the policy or update the documented expectations.

@ivanpauno
Copy link
Member Author

@rotu The difference with ros2/kdl_parser#7 (comment), is that you can still use the deprecated API, and it will do what's supposed to do.
That's not the case here.

There will be a note in the release notes, so people will have enough information to understand the issue.

@ros2/team for approval

@wjwwood
Copy link
Member

wjwwood commented May 7, 2020

It isn't working as it was intended to work.
That's a great reason to deprecate and gently redirect users.

Well I can't speak for everyone on our team, that's part of why I said we should include more reviewers, but I see no value in providing an API where the most reliable thing to do is throw "intentionally not implemented". I think it's better to remove it. It's not a "this other version is better" or "we wanted to change the name", it's a "this no longer even works and we can't replicate the old behavior".

Copy link
Member

@jacobperron jacobperron left a comment

Choose a reason for hiding this comment

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

I agree that removing the API is better than people using a deprecated API that has broken behavior. I think many will assume that a deprecated API will still work.

@rotu
Copy link

rotu commented May 7, 2020

I think many will assume that a deprecated API will still work.

That's what the message is for - informing the user of why an API is removed and how code should evolve.

C++: [[deprecated("Broken. Please use XXX instead.")]].
C: RCUTILS_DEPRECATED_WITH_MSG("Broken. Please use XXX instead.")

Removing a function is disruptive. It breaks the build and blocks direct testing of different versions of the same package. e.g. we couldn't test yesterday's CycloneDDS with tomorrow's rmw_implementation to compare whether a certain commit on a master branch broke the nightly.

Also, this redefines the existing numeric values of enum rmw_qos_liveliness_policy_t, another breaking change.

Copy link
Member

@dirk-thomas dirk-thomas left a comment

Choose a reason for hiding this comment

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

👍 to remove now.

Copy link

@rotu rotu left a comment

Choose a reason for hiding this comment

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

Please deprecate now and remove in a future version.

@wjwwood
Copy link
Member

wjwwood commented May 7, 2020

If the main concern is a message for the user, I'd be fine with having a stub in rmw which is deprecated, but continue with removing the implementations. The result will be a deprecation warning when using it, and a linker error later since the symbol is not provided.

I do not agree with providing a stub that just asserts or throws at runtime. I think that's just not useful for users.

@wjwwood
Copy link
Member

wjwwood commented May 7, 2020

Removing a function is disruptive. It breaks the build and blocks direct testing of different versions of the same package. e.g. we couldn't test yesterday's CycloneDDS with tomorrow's rmw_implementation to compare whether a certain commit on a master branch broke the nightly.

You could still do this test, you would just have to include the commit that removes these functions. Btw, if cyclone still implements these functions, but they are removed from rmw there will be no build failure...

The point about the enum's is a good one though, I agree with the suggestion to explicitly set them to avoid changes in the number for now.

@ivanpauno
Copy link
Member Author

Is that different than the deprecation warning with no implementation? I guess it's always a compiler error and not a warning? I'm fine with either.

Ah, yeah you're right. I will do that.

Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
@ivanpauno
Copy link
Member Author

ivanpauno commented May 8, 2020

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

@ivanpauno
Copy link
Member Author

@rotu
Copy link

rotu commented May 8, 2020

I think it's bad practice

Why?

are not backwards compatible and would necessitate a MAJOR version bump, not a minor one.

Why is that an issue?

In the end, it just comes down to a personal judgement. I think API compatibility and stability are attractive software features; and that major releases of a package should happen when necessary due to package needs, and not just because an upstream package wants to tie up loose ends. Contrary to a long history of the "ROS way" of big releases spanning many repositories with long periods of instability between releases, I think it's important to decouple development of different, individually versioned and repositoried codebases.

I think you have it backwards - you want to delete the declaration before the implementation.

If we were deprecating functionality we wanted to remove in the future, I'd agree. However, the difference here is that the functionality is gone now, no other option. There is no way to preserve the existing behavior, and that point is the reason why we cannot do what you laid out, not because we just don't want the take the steps. There's no opportunity to delete the declaration after the definition, we can either delete both now (original proposal for this pr) or delete the (no longer working) definition and leave the declaration only as a way to inform users why it is no longer there and then remove it later.
If you want a version with the function available, use the current version, if you want to move forward you have to stop using the function immediately, there is no in between where you get to keep using the function and just have a warning.

Sorry. I mean the function declaration before the function definition. You're right that the functionality is already gone. I think API stability and build compatibility are still worth preserving, even if that means gutting a few function implementations to no-ops for a release.

At any rate, I'm personally done discussing this in circles. My preference is to remove the definition now, leave something behind for users to run into (deprecated declaration or error macro), and do one major version bump release, and I don't think I will be persuaded otherwise. Others can weigh in if they want. Also, we can take what ever steps possible to avoid unnecessary breaks downstream, like the enum fix.

I agree. I think everything has been said and we've both laid out our cases fully. I'm sympathetic to your take. It's very sensible and well-thought out, and nobody want to release broken or ugly code.

@jacobperron
Copy link
Member

On the topic of bumping the version, I don't think it necessarily has to be a major bump as we have not release a 1.0.0 yet. I think a minor bump is also acceptable.

From https://semver.org/:

Major version zero (0.y.z) is for initial development. Anything MAY change at any time. The public API SHOULD NOT be considered stable.

@wjwwood
Copy link
Member

wjwwood commented May 8, 2020

@jacobperron sure, but the plan is to move this to 1.0.0 for foxy anyways, since as semver recommends:

How do I know when to release 1.0.0?

If your software is being used in production, it should probably already be 1.0.0. If you have a stable API on which users have come to depend, you should be 1.0.0. If you’re worrying a lot about backwards compatibility, you should probably already be 1.0.0.

I think some or all of those things are true for this package now.

@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-foxy-fitzroy-call-for-testing-and-package-releases/13998/1

Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
@ivanpauno
Copy link
Member Author

New CI round:

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

Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
…g it

Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
@ivanpauno
Copy link
Member Author

ivanpauno commented May 11, 2020

Build up to rmw_implementation, test rmw (to test that linters now pass, and enum value deprecation is fine):

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

MacOS failed randomly last few times, another try:

  • macOS Build Status

Retriggered Windows after failures:

  • Windows Build Status

Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
rmw/include/rmw/types.h Outdated Show resolved Hide resolved
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
@ivanpauno
Copy link
Member Author

ivanpauno commented May 12, 2020

Build up to rmw_implementation test rmw, after updated style in deprecation code:

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

Another full macos, because IDK what happened in last one:

  • macOS Build Status (unrelated failures)

Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
@jacobperron jacobperron added this to In progress in Foxy via automation May 12, 2020
@ivanpauno ivanpauno merged commit 36b415a into master May 12, 2020
Foxy automation moved this from In progress to Done May 12, 2020
@delete-merged-branch delete-merged-branch bot deleted the ivanpauno/remove-manual-by-node-liveliness branch May 12, 2020 17:52
Arnatious pushed a commit to Arnatious/nodl that referenced this pull request May 15, 2020
(upstream api break from ros2/rmw#227)

Signed-off-by: Ted Kern <ted.kern@canonical.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in review Waiting for review (Kanban column)
Projects
No open projects
Foxy
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

6 participants