tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 6394a18194c944bd4b71b7fbcdc7f8b122f6ddaa
parent 0e6cfdfb47e2203aae51bdc940081850f359962d
Author: Julien Cristau <jcristau@mozilla.com>
Date:   Fri,  7 Nov 2025 10:22:59 +0000

Bug 1998715 - stop the decision task's resource monitor on failure. r=ahal

Differential Revision: https://phabricator.services.mozilla.com/D271614

Diffstat:
Mtaskcluster/mach_commands.py | 24+++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/taskcluster/mach_commands.py b/taskcluster/mach_commands.py @@ -258,10 +258,22 @@ def taskgraph_decision(command_context, **options): if in_automation and moz_upload_dir: monitor = SystemResourceMonitor(poll_interval=0.1) monitor.start() + else: + monitor = None + + try: + start = time.monotonic() + ret = taskgraph_commands["decision"].func(options) + end = time.monotonic() + finally: + if monitor is not None: + monitor.stop() + upload_dir = pathlib.Path(moz_upload_dir) + profile_path = upload_dir / "profile_build_resources.json" + with open(profile_path, "w", encoding="utf-8", newline="\n") as f: + to_write = json.dumps(monitor.as_profile(), separators=(",", ":")) + f.write(to_write) - start = time.monotonic() - ret = taskgraph_commands["decision"].func(options) - end = time.monotonic() if in_automation: perfherder_data = { "framework": {"name": "build_metrics"}, @@ -286,12 +298,6 @@ def taskgraph_decision(command_context, **options): with out_path.open("w", encoding="utf-8") as f: json.dump(perfherder_data, f) - monitor.stop() - profile_path = upload_dir / "profile_build_resources.json" - with open(profile_path, "w", encoding="utf-8", newline="\n") as f: - to_write = json.dumps(monitor.as_profile(), separators=(",", ":")) - f.write(to_write) - return ret except Exception: traceback.print_exc()