Bug 1278757
Summary: | [RFE] - handle SIGTERM in rteval as end of run | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Jiri Kastner <jkastner> |
Component: | rteval | Assignee: | Luis Claudio R. Goncalves <lgoncalv> |
Status: | CLOSED ERRATA | QA Contact: | Jiri Kastner <jkastner> |
Severity: | unspecified | Docs Contact: | Maxim Svistunov <msvistun> |
Priority: | unspecified | ||
Version: | 7.3 | CC: | bhu, jkacur, jkastner, kzhang, msvistun, williams |
Target Milestone: | rc | Keywords: | FutureFeature |
Target Release: | 7.3 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Enhancement | |
Doc Text: |
The rteval program program now treats both SIGINT and SIGTERM as stop events and preserves all the data that has been gathered up to the event.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2016-11-04 01:34:06 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1274397, 1282922, 1313485 |
Description
Jiri Kastner
2015-11-06 11:07:21 UTC
This proposed patch changes run behavior to treat both SIGINT and SIGTERM as stop events. Is this what you're looking for? diff --git a/rteval/__init__.py b/rteval/__init__.py index 8ff8429277de..15209da2e7b2 100644 --- a/rteval/__init__.py +++ b/rteval/__init__.py @@ -24,7 +24,7 @@ # """ -Copyright (c) 2008-2013 Red Hat Inc. +Copyright (c) 2008-2016 Red Hat Inc. Realtime verification utility """ @@ -44,17 +44,15 @@ import version RTEVAL_VERSION = version.RTEVAL_VERSION -sigint_received = False +stopsig_received = False def sig_handler(signum, frame): - if signum == signal.SIGINT: - global sigint_received - sigint_received = True - print "*** SIGINT received - stopping rteval run ***" - elif signum == signal.SIGTERM: - raise RuntimeError("SIGTERM received!") - - + if signum == signal.SIGINT or signum == signal.SIGTERM: + global stopsig_received + stopsig_received = True + print "*** stop signal received - stopping rteval run ***" + else: + raise RuntimeError("SIGNAL received! (%d)" % signum) class RtEval(rtevalReport): def __init__(self, config, loadmods, measuremods, logger): @@ -209,7 +207,7 @@ sigint_received = False currtime = time.time() rpttime = currtime + report_interval load_avg_checked = 5 - while (currtime <= stoptime) and not sigint_received: + while (currtime <= stoptime) and not stopsig_received: time.sleep(60.0) if not measure_profile.isAlive(): stoptime = currtime Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2016-2244.html |