Skip to content

Conversation

@hidmic
Copy link
Contributor

@hidmic hidmic commented Jun 16, 2021

Precisely what the title says. Connected to #506. Needs osrf/osrf_pycommon#75.

hidmic and others added 6 commits June 16, 2021 10:21
Unix asyncio loops override existing signal wakeup file descriptors with no regards for existing ones -- set by user code or by another loop

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
… a socket.socket() works (#494)

Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
@hidmic hidmic requested review from jacobperron and mjeronimo June 16, 2021 14:54
@hidmic
Copy link
Contributor Author

hidmic commented Jun 16, 2021

@jacobperron this is what the change to Foxy would look like. Unit tests pass locally, though I have not run full Foxy CI just yet.

@felixdivo
Copy link

felixdivo commented Jun 17, 2021

@hidmic I could not find any docs on how to install this locally while overriding the stuff installed via apt. Do I simply clone and pip install . it globally (for the time being)?

@hidmic
Copy link
Contributor Author

hidmic commented Jun 17, 2021

@hidmic I could not find any docs on how to install this locally while overriding the stuff installed via apt. Do I simply clone and pip install . it globally (for the time being)?

The simplest approach is probably to build an overlay workspace with osrf_pycommon and launch in it, checked out at the right branches.

@felixdivo
Copy link

Okay, I managed to install it in a more hacky way but it worked. The PR seems the fix the issue, everything seems to work fine when I issue a SIGINT via process.send_signal(SIGINT):

[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
[DEBUG] [launch.launch_context]: emitting event synchronously: 'launch.events.Shutdown'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x7fe5c507a910>'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x7fe5c507a910>' ✓ '<launch.event_handlers.on_shutdown.OnShutdown object at 0x7fe5c507a220>'
[DEBUG] [launch.launch_context]: emitting event synchronously: 'launch.events.process.SignalProcess'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x7fe5c507a910>' ✓ '<launch.event_handlers.on_shutdown.OnShutdown object at 0x7fe5c519e190>'
[DEBUG] [launch]: processing event: '<launch.events.process.signal_process.SignalProcess object at 0x7fe5c507ae80>'
[DEBUG] [launch]: processing event: '<launch.events.process.signal_process.SignalProcess object at 0x7fe5c507ae80>' ✓ '<launch.event_handler.EventHandler object at 0x7fe5c4684fa0>'
[INFO] [mynode-1]: sending signal 'SIGINT' to process[mynode-1]
[INFO] [mynode-1]: process has finished cleanly [pid 16868]

@hidmic
Copy link
Contributor Author

hidmic commented Jun 18, 2021

Full Foxy CI:

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

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
@hidmic
Copy link
Contributor Author

hidmic commented Jun 22, 2021

Full Foxy CI after 4b7e29b:

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

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
@felixdivo
Copy link

felixdivo commented Jun 22, 2021

Since this is soon coming to an end thanks to @hidmic, shouldn't this be added to Foxy Patch Release 5?

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.

Looks okay to me; one concern about the deprecation warnings.

Use AsyncSafeSignalManager instead
"""
warnings.warn(
Copy link
Member

Choose a reason for hiding this comment

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

I'd rather not release deprecation warnings into a long-standing ROS distro to avoid disruption. Besides, users who have already switched to Galactic would have already run into the API change without a tick-tock cycle. There may be other opinions.

Choose a reason for hiding this comment

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

I can only give one user's opinion (mine/my team's): I'd like to get warned of breakages as soon a possible. We'd have to change it eventually in any way since we move over to newer versions of ROS2 eventually (LTS -> LTS). And if not, a warnings.simplefilter() ist easy to implement if one does not want to see the message for the time being.

But you know best what's common practice in ROS. This isn't Rolling Ridley, after all.

Copy link
Contributor

Choose a reason for hiding this comment

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

I have to agree with @jacobperron ; I don't think we should introduce new deprecation warnings into a stable distribution. Having new warnings show up for Foxy users as a result of sudo apt-get update is really user-unfriendly.

When people port to Galactic or Rolling, they'll get the warnings.

Copy link
Contributor Author

@hidmic hidmic Jun 23, 2021

Choose a reason for hiding this comment

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

Alright, see d8e320a.

However I will say that, while I agree that introducing warnings into a patch release of a stable distribution is not ideal, this patch is not transparent. Signals now go through wakeup file descriptors and handling is deferred to the main-thread local asyncio loop (assuming it is run). Depending on how the old signal management API was used (the only case in which you'd get a warning) this can potentially break those use cases -- silently as of d8e320a.

Which is why I didn't even think of backporting anything, and I probably wouldn't if these bits were not kinda broken in Foxy.

When people port to Galactic or Rolling, they'll get the warnings.

The old API was completely removed in Galactic, so no warnings (there's no way to re-implement it in terms of the new API so as to be functionally equivalent, as exposed above). This patch is a retrofit of the original patch.

Copy link
Member

Choose a reason for hiding this comment

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

I didn't fully comprehend the nature of the change. If there's a risk that we're breaking somebody, then I think issuing a warning is a good thing. I don't like the idea of releasing breaking changes in Foxy, but if you think the fix is worth the potential churn then I'd rather be very loud about it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, without this fix, launch hangs every now and then. It's the same we've experienced with ros2cli tests before. And it hit @felixdivo, so it may hit others too.

I agree about being loud. I thought a warning would be OK, but perhaps it's too loud. @clalancette ?

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like we are stuck between a rock and a hard place. While I don't like introducing new warnings into a stable distribution, silently breaking users isn't good either.

In this case, I'll defer to your best judgement on what to do here. You obviously have a much better handle on the issue and launch in general than I do.

Copy link
Member

Choose a reason for hiding this comment

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

Presumably, the these signal APIs are not very popular so I'd hope the number of affected users would be small.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright, I put deprecation warnings back in. I'll merge this PR into #506 and run CI there.

hidmic added 2 commits June 23, 2021 12:32
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
This reverts commit d8e320a.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
@hidmic hidmic merged commit f21e21c into mjeronimo/backport-476-to-foxy Jun 29, 2021
@delete-merged-branch delete-merged-branch bot deleted the hidmic/adapt/mjeronimo/backport-476-to-foxy branch June 29, 2021 15:35
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.

6 participants