aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2024-06-13 21:34:36 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2024-06-13 21:44:13 +0300
commit46448e428e94a7f8e518923609910d0b6d7caab3 (patch)
tree843abcc8fce2ef03cbe7bd9edf1e019a45ed1024
parent9051e2318afc1bfbd88a103f7392e622aa8c9527 (diff)
downloadydb-46448e428e94a7f8e518923609910d0b6d7caab3.tar.gz
Intermediate changes
-rw-r--r--library/python/cores/__init__.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/library/python/cores/__init__.py b/library/python/cores/__init__.py
index 3001187b22..f5b1bb2478 100644
--- a/library/python/cores/__init__.py
+++ b/library/python/cores/__init__.py
@@ -66,12 +66,12 @@ def recover_core_dump_file(binary_path, cwd, pid, core_pattern=None):
if core_pattern and not core_pattern.startswith("|"):
default_pattern.mask = os.path.basename(core_pattern)
else:
- core_uses_pid = int(_read_file("/proc/sys/kernel/core_uses_pid"))
- logger.debug("core_uses_pid = '%d'", core_uses_pid)
- if core_uses_pid == 0:
- default_pattern.mask = "core"
- else:
- default_pattern.mask = "core.%p"
+ default_pattern.mask = "core"
+
+ core_uses_pid = int(_read_file("/proc/sys/kernel/core_uses_pid"))
+ logger.debug("core_uses_pid = '%d'", core_uses_pid)
+ if core_uses_pid == 1 and "%p" not in re.split(r"(%.)", default_pattern.mask):
+ default_pattern.mask += ".%p"
# widely distributed core dump dir and mask (see DEVTOOLS-4408)
yandex_pattern = CoreFilePattern('/coredumps', '%e.%p.%s')