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

add signal handler SIGIN/SIGTERM to ros2run. #899

Open
wants to merge 1 commit into
base: rolling
Choose a base branch
from

Conversation

fujitatomoya
Copy link
Collaborator

address #895

@fujitatomoya
Copy link
Collaborator Author

CC: @clalancette @sloretz

@fujitatomoya
Copy link
Collaborator Author

CI:

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

@fujitatomoya
Copy link
Collaborator Author

CI:

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

Copy link

@rafa-martin rafa-martin left a comment

Choose a reason for hiding this comment

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

Hi, I tested this patch, and it works. (tested on ubuntu 22 with humble).

@fujitatomoya fujitatomoya force-pushed the fujitatomoya/20240422-ros2run-signal-handler branch from c999e25 to 6177388 Compare August 3, 2024 21:48
@fujitatomoya
Copy link
Collaborator Author

@rafa-martin thanks for checking.

@clalancette @sloretz @ahcorde can either of you have a look?

@MichaelOrlov
Copy link

@ros-pull-request-builder retest this please

@MichaelOrlov
Copy link

@clalancette @sloretz @ahcorde Friendly ping for review

@MichaelOrlov
Copy link

@fujitatomoya There are some test failures in the RPR job and they are repeating after RPR job re-run.
Also the previous Linux CI job was also failing. Need to either restart it or address failures.
Could you please take a look at it?

@fujitatomoya
Copy link
Collaborator Author

all tests seem to be passed, but no result available error with rpr job. (https://build.ros2.org/job/Rpr__ros2cli__ubuntu_noble_amd64/24/testReport/(root)/ros2cli/pytest_missing_result/)

i will rebase and restart the CI again.

@fujitatomoya fujitatomoya force-pushed the fujitatomoya/20240422-ros2run-signal-handler branch from 6177388 to 0d30dda Compare August 22, 2024 17:29
@fujitatomoya
Copy link
Collaborator Author

fujitatomoya commented Aug 22, 2024

CI:

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

@MichaelOrlov
Copy link

@fujitatomoya As regards:

all tests seem to be passed, but no result available error with rpr job. (https://build.ros2.org/job/Rpr__ros2cli__ubuntu_noble_amd64/24/testReport/(root)/ros2cli/pytest_missing_result/)

i will rebase and restart the CI again.

From the raw log section

Summary: 15 packages finished [20min 27s]
13 packages had stderr output: ros2action ros2cli ros2component ros2doctor ros2interface ros2lifecycle ros2multicast ros2node ros2param ros2pkg ros2run ros2service ros2topic
1 package had test failures: ros2cli

It was a segfault in python code and test timed out.
A bit of details about failure from the same log:

Click to expand

Starting >>> ros2cli
============================= test session starts ==============================
platform linux -- Python 3.12.3, pytest-7.4.4, pluggy-1.4.0
cachedir: /tmp/ws/build_isolated/ros2cli/.pytest_cache
rootdir: /tmp/ws/src/ros2cli
configfile: pytest.ini
plugins: ament-lint-0.18.1, ament-copyright-0.18.1, ament-xmllint-0.18.1, launch-testing-3.6.1, ament-flake8-0.18.1, ament-pep257-0.18.1, launch-testing-ros-0.27.2, colcon-core-0.17.0, cov-4.1.0, timeout-2.2.0, rerunfailures-12.0
timeout: 900.0s
timeout method: thread
timeout func_only: False
collected 31 items

test/test_copyright.py . [ 3%]
test/test_daemon.py ................... [ 64%]
test/test_direct.py .... [ 77%]
Fatal Python error: Segmentation fault

Current thread 0x00007f5814d77140 (most recent call first):
Garbage-collecting
File "/usr/lib/python3.12/collections/init.py", line 447 in _make
File "/usr/lib/python3.12/tokenize.py", line 577 in _generate_tokens_from_c_tokenizer
File "/usr/lib/python3/dist-packages/flake8_quotes/init.py", line 203 in get_noqa_lines
File "/usr/lib/python3/dist-packages/flake8_quotes/init.py", line 195 in run
File "/usr/lib/python3/dist-packages/flake8/checker.py", line 428 in run_ast_checks
File "/usr/lib/python3/dist-packages/flake8/checker.py", line 526 in run_checks
File "/usr/lib/python3/dist-packages/flake8/checker.py", line 83 in _mp_run
File "/usr/lib/python3.12/multiprocessing/pool.py", line 125 in worker
File "/usr/lib/python3.12/multiprocessing/process.py", line 108 in run
File "/usr/lib/python3.12/multiprocessing/process.py", line 314 in _bootstrap
File "/usr/lib/python3.12/multiprocessing/popen_fork.py", line 71 in _launch
File "/usr/lib/python3.12/multiprocessing/popen_fork.py", line 19 in init
File "/usr/lib/python3.12/multiprocessing/context.py", line 282 in _Popen
File "/usr/lib/python3.12/multiprocessing/process.py", line 121 in start
File "/usr/lib/python3.12/multiprocessing/pool.py", line 329 in _repopulate_pool_static
File "/usr/lib/python3.12/multiprocessing/pool.py", line 306 in _repopulate_pool
File "/usr/lib/python3.12/multiprocessing/pool.py", line 215 in init
File "/usr/lib/python3.12/multiprocessing/context.py", line 119 in Pool
File "/usr/lib/python3/dist-packages/flake8/checker.py", line 589 in _try_initialize_processpool
File "/usr/lib/python3/dist-packages/flake8/checker.py", line 197 in run_parallel
File "/usr/lib/python3/dist-packages/flake8/checker.py", line 236 in run
File "/usr/lib/python3/dist-packages/flake8/main/application.py", line 103 in run_checks
File "/usr/lib/python3/dist-packages/flake8/api/legacy.py", line 116 in check_files
File "/opt/ros/rolling/lib/python3.12/site-packages/ament_flake8/main.py", line 281 in generate_flake8_report
File "/opt/ros/rolling/lib/python3.12/site-packages/ament_flake8/main.py", line 88 in main_with_errors
File "/tmp/ws/src/ros2cli/ros2cli/test/test_flake8.py", line 22 in test_flake8
File "/usr/lib/python3/dist-packages/_pytest/python.py", line 194 in pytest_pyfunc_call
File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 102 in _multicall
File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 119 in _hookexec
File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 501 in call
File "/usr/lib/python3/dist-packages/_pytest/python.py", line 1792 in runtest
File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 169 in pytest_runtest_call
File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 102 in _multicall
File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 119 in _hookexec
File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 501 in call
File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 262 in
File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 341 in from_call
File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 261 in call_runtest_hook
File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 222 in call_and_report
File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 133 in runtestprotocol
File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 114 in pytest_runtest_protocol
File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 102 in _multicall
File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 119 in _hookexec
File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 501 in call
File "/usr/lib/python3/dist-packages/_pytest/main.py", line 350 in pytest_runtestloop
File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 102 in _multicall
File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 119 in _hookexec
File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 501 in call
File "/usr/lib/python3/dist-packages/_pytest/main.py", line 325 in _main
File "/usr/lib/python3/dist-packages/_pytest/main.py", line 271 in wrap_session
File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318 in pytest_cmdline_main
File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 102 in _multicall
File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 119 in _hookexec
File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 501 in call
File "/usr/lib/python3/dist-packages/_pytest/config/init.py", line 169 in main
File "/usr/lib/python3/dist-packages/_pytest/config/init.py", line 192 in console_main
File "/usr/lib/python3/dist-packages/pytest/main.py", line 5 in
File "", line 88 in _run_code
File "", line 198 in _run_module_as_main

Extension modules: yaml._yaml, numpy.core._multiarray_umath, numpy.core._multiarray_tests, numpy.linalg._umath_linalg, numpy.fft._pocketfft_internal, numpy.random._common, numpy.random.bit_generator, numpy.random._bounded_integers, numpy.random._mt19937, numpy.random.mtrand, numpy.random._philox, numpy.random._pcg64, numpy.random._sfc64, numpy.random._generator, psutil._psutil_linux, psutil._psutil_posix, rcl_interfaces.rcl_interfaces_s__rosidl_typesupport_c, builtin_interfaces.builtin_interfaces_s__rosidl_typesupport_c, service_msgs.service_msgs_s__rosidl_typesupport_c, type_description_interfaces.type_description_interfaces_s__rosidl_typesupport_c, test_msgs.test_msgs_s__rosidl_typesupport_c, action_msgs.action_msgs_s__rosidl_typesupport_c, unique_identifier_msgs.unique_identifier_msgs_s__rosidl_typesupport_c (total: 23)
Fatal Python error: Segmentation fault

Current thread 0x00007f5814d77140 (most recent call first):
Garbage-collecting
File "/usr/lib/python3.12/collections/init.py", line 447 in _make
File "/usr/lib/python3.12/tokenize.py", line 577 in _generate_tokens_from_c_tokenizer
File "/usr/lib/python3/dist-packages/flake8_quotes/init.py", line 203 in get_noqa_lines
File "/usr/lib/python3/dist-packages/flake8_quotes/init.py", line 195 in run
File "/usr/lib/python3/dist-packages/flake8/checker.py", line 428 in run_ast_checks
File "/usr/lib/python3/dist-packages/flake8/checker.py", line 526 in run_checks
File "/usr/lib/python3/dist-packages/flake8/checker.py", line 83 in _mp_run
File "/usr/lib/python3.12/multiprocessing/pool.py", line 125 in worker
File "/usr/lib/python3.12/multiprocessing/process.py", line 108 in run
File "/usr/lib/python3.12/multiprocessing/process.py", line 314 in _bootstrap
File "/usr/lib/python3.12/multiprocessing/popen_fork.py", line 71 in _launch
File "/usr/lib/python3.12/multiprocessing/popen_fork.py", line 19 in init
File "/usr/lib/python3.12/multiprocessing/context.py", line 282 in _Popen
File "/usr/lib/python3.12/multiprocessing/process.py", line 121 in start
File "/usr/lib/python3.12/multiprocessing/pool.py", line 329 in _repopulate_pool_static
File "/usr/lib/python3.12/multiprocessing/pool.py", line 306 in _repopulate_pool
File "/usr/lib/python3.12/multiprocessing/pool.py", line 215 in init
File "/usr/lib/python3.12/multiprocessing/context.py", line 119 in Pool
File "/usr/lib/python3/dist-packages/flake8/checker.py", line 589 in _try_initialize_processpool
File "/usr/lib/python3/dist-packages/flake8/checker.py", line 197 in run_parallel
File "/usr/lib/python3/dist-packages/flake8/checker.py", line 236 in run
File "/usr/lib/python3/dist-packages/flake8/main/application.py", line 103 in run_checks
File "/usr/lib/python3/dist-packages/flake8/api/legacy.py", line 116 in check_files
File "/opt/ros/rolling/lib/python3.12/site-packages/ament_flake8/main.py", line 281 in generate_flake8_report
File "/opt/ros/rolling/lib/python3.12/site-packages/ament_flake8/main.py", line 88 in main_with_errors
File "/tmp/ws/src/ros2cli/ros2cli/test/test_flake8.py", line 22 in test_flake8
File "/usr/lib/python3/dist-packages/_pytest/python.py", line 194 in pytest_pyfunc_call
File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 102 in _multicall
File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 119 in _hookexec
File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 501 in call
File "/usr/lib/python3/dist-packages/_pytest/python.py", line 1792 in runtest
File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 169 in pytest_runtest_call
File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 102 in _multicall
File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 119 in _hookexec
File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 501 in call
File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 262 in
File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 341 in from_call
File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 261 in call_runtest_hook
File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 222 in call_and_report
File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 133 in runtestprotocol
File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 114 in pytest_runtest_protocol
File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 102 in _multicall
File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 119 in _hookexec
File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 501 in call
File "/usr/lib/python3/dist-packages/_pytest/main.py", line 350 in pytest_runtestloop
File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 102 in _multicall
File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 119 in _hookexec
File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 501 in call
File "/usr/lib/python3/dist-packages/_pytest/main.py", line 325 in _main
File "/usr/lib/python3/dist-packages/_pytest/main.py", line 271 in wrap_session
File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318 in pytest_cmdline_main
File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 102 in _multicall
File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 119 in _hookexec
File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 501 in call
File "/usr/lib/python3/dist-packages/_pytest/config/init.py", line 169 in main
File "/usr/lib/python3/dist-packages/_pytest/config/init.py", line 192 in console_main
File "/usr/lib/python3/dist-packages/pytest/main.py", line 5 in
File "", line 88 in _run_code
File "", line 198 in _run_module_as_main

Extension modules: yaml._yaml, numpy.core._multiarray_umath, numpy.core._multiarray_tests, numpy.linalg._umath_linalg, numpy.fft._pocketfft_internal, numpy.random._common, numpy.random.bit_generator, numpy.random._bounded_integers, numpy.random._mt19937, numpy.random.mtrand, numpy.random._philox, numpy.random._pcg64, numpy.random._sfc64, numpy.random._generator, psutil._psutil_linux, psutil._psutil_posix, rcl_interfaces.rcl_interfaces_s__rosidl_typesupport_c, builtin_interfaces.builtin_interfaces_s__rosidl_typesupport_c, service_msgs.service_msgs_s__rosidl_typesupport_c, type_description_interfaces.type_description_interfaces_s__rosidl_typesupport_c, test_msgs.test_msgs_s__rosidl_typesupport_c, action_msgs.action_msgs_s__rosidl_typesupport_c, unique_identifier_msgs.unique_identifier_msgs_s__rosidl_typesupport_c (total: 23)

+++++++++++++++++++++++++++++++++++ Timeout ++++++++++++++++++++++++++++++++++++

@fujitatomoya
Copy link
Collaborator Author

RHEL failure is missing result, that i am not sure what went wrong. I will retry RHEL CI.

  • Linux-rhel Build Status

about rpr job failure, that is segmentation fault during garbage-collecting, stack trace does not even include our fix...

@fujitatomoya
Copy link
Collaborator Author

@ros-pull-request-builder retest this please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

3 participants