Processes started by ros2 launch inherit its DDS sockets
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 55/100
調査の方向性
Start with ExecuteLocal and osrf_pycommon/process_utils/async_execute_process_asyncio/impl.py#L40-L47, then run the leak.launch.py reproduction and inspect inherited file descriptors. Done means child processes no longer hold launch's DDS sockets while retaining their own, verified with the Ubuntu or macOS socket checks described in the issue.
索引モデルが issue の本文から書いたものです。
説明
Operating System:
Ubuntu 22.04.5 (arm64) and macOS 26.5.2 (arm64)
ROS version or commit hash:
Humble from apt (launch 1.0.15, osrf_pycommon 2.1.6) and Jazzy from RoboStack (launch 3.4.11, osrf_pycommon 2.1.7). Rolling has the same code.
RMW implementation (if applicable):
rmw_fastrtps_cpp
RMW Configuration (if applicable):
Defaults on Ubuntu, FASTDDS_BUILTIN_TRANSPORTS=UDPv4 on macOS
Client library (if applicable):
rclcpp, rclpy
'ros2 doctor --report' output
n/a
Steps to reproduce issue
Loading a component makes launch create its own node, even before the container process starts. Save this as leak.launch.py:
from launch import LaunchDescription
from launch.actions import TimerAction
from launch_ros.actions import ComposableNodeContainer, Node
from launch_ros.descriptions import ComposableNode
def generate_launch_description():
container = ComposableNodeContainer(
name='container', namespace='', package='rclcpp_components',
executable='component_container',
composable_node_descriptions=[ComposableNode(
package='tf2_ros', plugin='tf2_ros::StaticTransformBroadcasterNode',
name='stf_component',
parameters=[{'frame_id': 'a', 'child_frame_id': 'b'}])])
late = TimerAction(period=4.0, actions=[Node(
package='tf2_ros', executable='static_transform_publisher',
arguments=['--frame-id', 'a', '--child-frame-id', 'c'])])
return LaunchDescription([container, late])
-
ros2 launch leak.launch.py -
After 5 s, in a second terminal:
L=$(pgrep -f 'ros2 launch leak.launch.py'); s() { ls -l /proc/$1/fd | grep -o 'socket:\[[0-9]*\]' | sort; }; for c in $(pgrep -P $L); do echo "$(cat /proc/$c/comm) holds $(comm -12 <(s $L) <(s $c) | wc -l) of launch's $(s $L | wc -l) sockets"; doneOn macOS, compare the DEVICE column of
lsof -a -p <pid> -i UDPinstead.
Expected behavior
Each child holds only its own sockets, so step 2 prints holds 0 for both.
Actual behavior
On Ubuntu, step 2 prints:
component_conta holds 8 of launch's 12 sockets
static_transfor holds 8 of launch's 12 sockets
All 5 of launch's UDP sockets are among them. On macOS, both children hold all 8 of launch's UDP sockets.
Additional information
ExecuteLocal starts processes with osrf_pycommon's async_execute_process, which passes close_fds=False (impl.py#L40-L47). Fast DDS opens its sockets without close-on-exec, so once launch creates its own node, every process it starts inherits that node's sockets. On macOS, when the kernel shuts down a child's sockets after a network-buffer shortage, launch's DDS goes down too, because the sockets are shared.
I'll open an osrf_pycommon PR that adds a close_fds option, so ExecuteLocal could pass close_fds=True.
Assisted-by: Claude Opus 5.5
- 主要言語
- Python
- スター
- 156
- フォーク
- 200
- 平均マージ
- 2日 11時間
- マージ済み PR(30日)
- 11
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ros2/launch のほかの issue
-
Use a relative target for the `latest` log symlink so it survives different absolute mount paths (host/Docker)対応中かも @Old-Ding が 139 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
ros2/launch#978 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Add OpaqueFunction to list at docs.ros.org再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンbug help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
メンテナーはふだん 1 日以内に返信
-
[launch_testing] pytest>8.1 dropped the legacy "path" argument from its internal hooks on humble対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
-
`--print-description` option shows unhelpful output対応中かも @official-burak が 93 日前に担当しました。 オープンbug
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
gke-labs/kube-agents#7441 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
bug confirmed issue
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
open-webui/open-webui#35142 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信