Skip to content

Commit

Permalink
Merge pull request #10619 from petr-balogh/enable-fault-handler
Browse files Browse the repository at this point in the history
Add traceback dump
  • Loading branch information
petr-balogh authored Oct 7, 2024
2 parents 4bd53a2 + 86e06ee commit d7088c1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ocs_ci/framework/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import argparse
import faulthandler
import os
import re
import signal
Expand All @@ -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")
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit d7088c1

Please sign in to comment.