From 4dbe1588a6fe2a7987f0a0b7d7aa02c0df69e8f1 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Mon, 11 Apr 2022 11:58:37 +0200 Subject: [PATCH] sculpt: relax heartbeat rate This patch reduces the response time of supposedly stuck situations like an unresponsive part_block component. First, it reduces the heartbeat rate from 1 to 2 seconds to make it consistent with the frequency of state reports. Second, it allows up to four skipped heartbeats until regarding the situation as stuck. With those changes, the prolonged initialization sequence of a USB ZIP drive succeeds with Sculpt. --- repos/gems/src/app/sculpt_manager/main.cc | 2 +- repos/gems/src/app/sculpt_manager/model/child_exit_state.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/repos/gems/src/app/sculpt_manager/main.cc b/repos/gems/src/app/sculpt_manager/main.cc index c2bae02eaa..4ec2331d3b 100644 --- a/repos/gems/src/app/sculpt_manager/main.cc +++ b/repos/gems/src/app/sculpt_manager/main.cc @@ -1797,7 +1797,7 @@ void Sculpt::Main::_generate_runtime_config(Xml_generator &xml) const xml.attribute("buffer", "1M"); }); - xml.node("heartbeat", [&] () { xml.attribute("rate_ms", 1000); }); + xml.node("heartbeat", [&] () { xml.attribute("rate_ms", 2000); }); xml.node("parent-provides", [&] () { gen_parent_service(xml); diff --git a/repos/gems/src/app/sculpt_manager/model/child_exit_state.h b/repos/gems/src/app/sculpt_manager/model/child_exit_state.h index b5989c2d5d..9768462220 100644 --- a/repos/gems/src/app/sculpt_manager/model/child_exit_state.h +++ b/repos/gems/src/app/sculpt_manager/model/child_exit_state.h @@ -46,7 +46,7 @@ struct Sculpt::Child_exit_state code = (int)child.attribute_value("exited", 0L); } - responsive = (child.attribute_value("skipped_heartbeats", 0U) <= 2); + responsive = (child.attribute_value("skipped_heartbeats", 0U) <= 4); } }); }