From 86e06ee054cd831733cf2f9ca3f1510649f8c817 Mon Sep 17 00:00:00 2001 From: Petr Balogh Date: Sat, 5 Oct 2024 22:48:24 +0200 Subject: [PATCH] Add traceback dump Signed-off-by: Petr Balogh --- ocs_ci/framework/main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ocs_ci/framework/main.py b/ocs_ci/framework/main.py index 64d7c746ab8..aaddd5d7a13 100644 --- a/ocs_ci/framework/main.py +++ b/ocs_ci/framework/main.py @@ -1,4 +1,5 @@ import argparse +import faulthandler import os import re import signal @@ -21,6 +22,9 @@ def signal_term_handler(sig, frame): print(f"Got SIGTERM: {sig}") if hasattr(framework.config, "RUN"): framework.config.RUN["aborted"] = True + logdir = framework.config.RUN["log_dir"] + with open(os.path.join(logdir, "traceback.log"), "w") as f: + faulthandler.dump_traceback(file=f) global kill_counter if kill_counter: print("Second attempt to SIGTERM, exiting process with RC: 143") @@ -314,6 +318,7 @@ def tokenize_per_cluster_args(args, nclusters): def main(argv=None): + faulthandler.enable() arguments = argv or sys.argv[1:] init_ocsci_conf(arguments) for i in range(framework.config.nclusters):