diff options
author | Олег <150132506+iddqdex@users.noreply.github.com> | 2024-12-25 14:07:56 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-25 11:07:56 +0000 |
commit | fd6bcad15abc0587cebad6fa10033122631bf251 (patch) | |
tree | 2998028796a785f7af80053d45107bf50ae5881c | |
parent | 97167ebef4e7b3ec0d5e53a4cf0547aabdc06e40 (diff) | |
download | ydb-fd6bcad15abc0587cebad6fa10033122631bf251.tar.gz |
Revert "Use google breakpad in ydbd (#12894)" (#12980)
-rw-r--r-- | ydb/apps/ydbd/ya.make | 1 | ||||
-rw-r--r-- | ydb/deploy/docker/Dockerfile | 12 | ||||
-rw-r--r-- | ydb/library/breakpad/minidumps.cpp | 34 | ||||
-rw-r--r-- | ydb/library/breakpad/ya.make | 14 | ||||
-rw-r--r-- | ydb/library/ya.make | 1 | ||||
-rw-r--r-- | ydb/tests/functional/minidumps/test_break.py | 18 | ||||
-rw-r--r-- | ydb/tests/functional/minidumps/ya.make | 24 | ||||
-rw-r--r-- | ydb/tests/functional/ya.make | 1 |
8 files changed, 11 insertions, 94 deletions
diff --git a/ydb/apps/ydbd/ya.make b/ydb/apps/ydbd/ya.make index 7b5e03b4aa..a3357b493d 100644 --- a/ydb/apps/ydbd/ya.make +++ b/ydb/apps/ydbd/ya.make @@ -67,7 +67,6 @@ PEERDIR( yql/essentials/udfs/common/url_base yql/essentials/udfs/common/yson2 yql/essentials/udfs/logs/dsv - ydb/library/breakpad ydb/public/sdk/cpp/client/ydb_persqueue_public/codecs ) diff --git a/ydb/deploy/docker/Dockerfile b/ydb/deploy/docker/Dockerfile index f47740a3ce..0a241f0576 100644 --- a/ydb/deploy/docker/Dockerfile +++ b/ydb/deploy/docker/Dockerfile @@ -24,13 +24,21 @@ COPY --chmod=0644 /liblibaio-dynamic.so /lib/liblibaio-dynamic.so ### # Base image with google brekpad assets ### - FROM ${BREAKPAD_INIT_IMAGE}:${BREAKPAD_INIT_IMAGE_TAG} AS breakpad_init + + +FROM base AS breakpad-setuid +COPY --from=breakpad_init /usr/lib/libbreakpad_init.so /usr/lib/libbreakpad_init.so +# workaround for old docker versions +# https://github.com/moby/buildkit/issues/3920 +RUN /usr/bin/chmod 4644 /usr/lib/libbreakpad_init.so + FROM base AS base-breakpad RUN \ apt-get -yqq update && \ apt-get -yqq install --no-install-recommends binutils gdb strace linux-tools-generic && \ apt-get clean && rm -rf /var/lib/apt/lists/* +ENV LD_PRELOAD=libbreakpad_init.so ENV BREAKPAD_MINIDUMPS_PATH=/opt/ydb/volumes/coredumps ENV BREAKPAD_MINIDUMPS_SCRIPT=/opt/ydb/bin/minidump_script.py # breakpad binaries @@ -38,6 +46,8 @@ COPY --chmod=0755 --from=breakpad_init /usr/bin/minidump_stackwalk /usr/bin/mini COPY --chmod=0755 --from=breakpad_init /usr/bin/minidump-2-core /usr/bin/minidump-2-core # minidump callback script COPY --chmod=0755 --chown=ydb /minidump_script.py /opt/ydb/bin/minidump_script.py +# minidump init library +COPY --link --from=breakpad-setuid /usr/lib/libbreakpad_init.so /usr/lib/libbreakpad_init.so FROM base AS ydbd-setcap COPY --chmod=0755 --chown=ydb /ydbd /opt/ydb/bin/ydbd diff --git a/ydb/library/breakpad/minidumps.cpp b/ydb/library/breakpad/minidumps.cpp deleted file mode 100644 index 692ac67d4d..0000000000 --- a/ydb/library/breakpad/minidumps.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#include <util/generic/ptr.h> -#include <contrib/libs/breakpad/src/client/linux/handler/exception_handler.h> -#include <unistd.h> -#include <sys/wait.h> - - -class TMinidumper { -public: - TMinidumper() { - if(const char* path = getenv("BREAKPAD_MINIDUMPS_PATH")) { - using namespace google_breakpad; - Handler = MakeHolder<ExceptionHandler>(MinidumpDescriptor(path), nullptr, DumpCallback, nullptr, true, -1, true); - } - } - -private: - static bool DumpCallback(const google_breakpad::MinidumpDescriptor& descriptor, void* context, bool succeeded) { - if (char* script = getenv("BREAKPAD_MINIDUMPS_SCRIPT")) { - if (auto pid = fork()) { - waitpid(pid, 0, 0); - } else { - char* dumpSucceded = succeeded ? (char *)"true" : (char *)"false"; - char* descriptorPath = succeeded ? (char *)descriptor.path() : (char *)"\0"; - char* cmd[] = {script, dumpSucceded, descriptorPath, NULL}; - execve(cmd[0], &cmd[0], NULL); - } - } - return succeeded; - } - - THolder<google_breakpad::ExceptionHandler> Handler; -}; - -TMinidumper Minidumper; diff --git a/ydb/library/breakpad/ya.make b/ydb/library/breakpad/ya.make deleted file mode 100644 index abb0a7c479..0000000000 --- a/ydb/library/breakpad/ya.make +++ /dev/null @@ -1,14 +0,0 @@ -LIBRARY() - -IF (OS_LINUX) - PEERDIR( - contrib/libs/breakpad/src - contrib/libs/breakpad/src/client/linux - ) - - SRCS( - GLOBAL minidumps.cpp - ) -ENDIF() - -END() diff --git a/ydb/library/ya.make b/ydb/library/ya.make index 20e9b74458..ed6724d58e 100644 --- a/ydb/library/ya.make +++ b/ydb/library/ya.make @@ -7,7 +7,6 @@ RECURSE( arrow_parquet backup benchmarks - breakpad chunks_limiter folder_service formats diff --git a/ydb/tests/functional/minidumps/test_break.py b/ydb/tests/functional/minidumps/test_break.py deleted file mode 100644 index ab3f137e23..0000000000 --- a/ydb/tests/functional/minidumps/test_break.py +++ /dev/null @@ -1,18 +0,0 @@ -import yatest.common -import os -from ydb.tests.library.harness.kikimr_runner import KiKiMR - - -def test_create_minidump(): - dump_path = os.path.join(yatest.common.tempfile.gettempdir(), 'dumps') - os.makedirs(dump_path, exist_ok=True) - os.environ['BREAKPAD_MINIDUMPS_PATH'] = dump_path - cluster = KiKiMR() - cluster.start() - for node in cluster.nodes.values(): - node.send_signal(6) - try: - cluster.stop() - except RuntimeError: - pass - assert len(os.listdir(dump_path)) == len(cluster.nodes) diff --git a/ydb/tests/functional/minidumps/ya.make b/ydb/tests/functional/minidumps/ya.make deleted file mode 100644 index 7ab70d5293..0000000000 --- a/ydb/tests/functional/minidumps/ya.make +++ /dev/null @@ -1,24 +0,0 @@ -IF (OS_LINUX) - -PY3TEST() - -TEST_SRCS( - test_break.py -) - -SIZE(MEDIUM) - -ENV(YDB_DRIVER_BINARY="ydb/apps/ydbd/ydbd") - -PEERDIR( - ydb/tests/library -) - -DEPENDS( - ydb/apps/ydbd -) - - -END() - -ENDIF() diff --git a/ydb/tests/functional/ya.make b/ydb/tests/functional/ya.make index d1d73bf95b..0b76e65922 100644 --- a/ydb/tests/functional/ya.make +++ b/ydb/tests/functional/ya.make @@ -16,7 +16,6 @@ RECURSE( kv_workload large_serializable limits - minidumps postgresql query_cache rename |