From e88334bd295fefe40b980ac590980ff1aa53c4c0 Mon Sep 17 00:00:00 2001 From: miro Date: Tue, 18 Jun 2024 03:53:51 +0100 Subject: [PATCH] fix/fallback_timeout_handling by using a killable_event we can abort fallbacks that timedout avoiding multiple answers closes https://github.com/OpenVoiceOS/ovos-core/issues/389 needs https://github.com/OpenVoiceOS/OVOS-workshop/pull/210 --- ovos_core/intent_services/fallback_service.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ovos_core/intent_services/fallback_service.py b/ovos_core/intent_services/fallback_service.py index 7d0059c9a248..f7dc350db1e9 100644 --- a/ovos_core/intent_services/fallback_service.py +++ b/ovos_core/intent_services/fallback_service.py @@ -148,13 +148,13 @@ def attempt_fallback(self, utterances, skill_id, lang, message): elif result is not None: return result.data.get('result', False) else: - # - # https://github.com/OpenVoiceOS/ovos-core/issues/389 + # abort any ongoing fallback # if skill crashed or returns False, all good - # if it is just taking a long time, more than 1 fallback will end up answering - # TODO - abort responses somehow? @killable_intents decorator? - LOG.error(f"{skill_id} took too long to answer, you may still receive it's delayed answer") - LOG.warning('increasing "timeout" in mycroft.conf might help alleviate this issue') + # if it is just taking a long time, more than 1 fallback would end up answering + self.bus.emit(message.forward("ovos.skills.fallback.force_timeout", + {"skill_id": skill_id})) + LOG.warning(f"{skill_id} took too long to answer, " + f'increasing "timeout" in mycroft.conf might help alleviate this issue') return False def _fallback_range(self, utterances, lang, message, fb_range):