[Python Interop] Add signal handler to python interop client and server (#37241)

Tested by manually introduce a segfault, able to see the backtrace:

![Screenshot 2024-07-17 at 12 53 45 PM](https://github.com/user-attachments/assets/069e79ac-f215-4964-8b91-bd7a9e64ebfe)

<!--

If you know who should review your pull request, please assign it to that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the appropriate
lang label.

-->

Closes #37241

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37241 from XuanWang-Amos:add_signal_handler_to_python_interop_client 7316c0ca51
PiperOrigin-RevId: 653671195
pull/37255/head
Xuan Wang 7 months ago committed by Copybara-Service
parent 695f017db3
commit 80436121e7
  1. 4
      src/python/grpcio_tests/tests/fork/BUILD.bazel
  2. 2
      src/python/grpcio_tests/tests_py3_only/interop/BUILD.bazel
  3. 3
      src/python/grpcio_tests/tests_py3_only/interop/xds_interop_client.py
  4. 3
      src/python/grpcio_tests/tests_py3_only/interop/xds_interop_server.py

@ -16,6 +16,10 @@ load("//bazel:cython_library.bzl", "pyx_library")
pyx_library(
name = "native_debug",
srcs = ["native_debug.pyx"],
visibility = [
"//src/python/grpcio_tests/tests/observability:__subpackages__",
"//src/python/grpcio_tests/tests_py3_only/interop:__subpackages__",
],
deps = ["@com_google_absl//absl/debugging:failure_signal_handler"],
)

@ -28,6 +28,7 @@ py_binary(
"//src/python/grpcio/grpc:grpcio",
"//src/python/grpcio_admin/grpc_admin",
"//src/python/grpcio_channelz/grpc_channelz/v1:grpc_channelz",
"//src/python/grpcio_tests/tests/fork:native_debug",
requirement("opentelemetry-exporter-prometheus"),
],
)
@ -46,6 +47,7 @@ py_binary(
"//src/python/grpcio_csm_observability/grpc_csm_observability:csm_observability",
"//src/python/grpcio_health_checking/grpc_health/v1:grpc_health",
"//src/python/grpcio_reflection/grpc_reflection/v1alpha:grpc_reflection",
"//src/python/grpcio_tests/tests/fork:native_debug",
requirement("opentelemetry-exporter-prometheus"),
],
)

@ -45,6 +45,9 @@ from src.proto.grpc.testing import empty_pb2
from src.proto.grpc.testing import messages_pb2
from src.proto.grpc.testing import test_pb2
from src.proto.grpc.testing import test_pb2_grpc
from src.python.grpcio_tests.tests.fork import native_debug
native_debug.install_failure_signal_handler()
logger = logging.getLogger()
console_handler = logging.StreamHandler()

@ -39,6 +39,9 @@ from src.proto.grpc.testing import empty_pb2
from src.proto.grpc.testing import messages_pb2
from src.proto.grpc.testing import test_pb2
from src.proto.grpc.testing import test_pb2_grpc
from src.python.grpcio_tests.tests.fork import native_debug
native_debug.install_failure_signal_handler()
# NOTE: This interop server is not fully compatible with all xDS interop tests.
# It currently only implements enough functionality to pass the xDS security

Loading…
Cancel
Save