mirror of
https://github.com/Skyvern-AI/skyvern.git
synced 2026-07-09 16:09:13 +00:00
feat(SKY-11609): attribute Temporal activity-timeout workflow finalization (#7148)
This commit is contained in:
parent
ef9476e8fa
commit
45505ef3e1
2 changed files with 55 additions and 1 deletions
|
|
@ -1,5 +1,12 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
|
||||
# Matches the activity/heartbeat timeout tokens the worker persists when a Temporal-activity
|
||||
# timeout finalizes a run. Word-anchored so "inactivity timeout" (a distinct page-level reason)
|
||||
# is NOT caught and correctly stays PAGE_LOAD_TIMEOUT.
|
||||
_INFRA_TIMEOUT_RE = re.compile(r"\b(?:activity|heartbeat) timeout\b")
|
||||
|
||||
|
||||
def classify_from_failure_reason(
|
||||
failure_reason: str | None,
|
||||
|
|
@ -102,8 +109,21 @@ def classify_from_failure_reason(
|
|||
}
|
||||
)
|
||||
|
||||
# Infrastructure timeout — a Temporal activity / heartbeat timeout finalizes the run from
|
||||
# the worker layer (a stalled activity or worker interruption), not a site/page-load issue.
|
||||
# Classify before PAGE_LOAD_TIMEOUT so these don't masquerade as site slowness.
|
||||
_is_infra_timeout = bool(_INFRA_TIMEOUT_RE.search(reason))
|
||||
if _is_infra_timeout:
|
||||
categories.append(
|
||||
{
|
||||
"category": "INFRASTRUCTURE_ERROR",
|
||||
"confidence_float": 0.9,
|
||||
"reasoning": "Activity/heartbeat timeout finalized the run",
|
||||
}
|
||||
)
|
||||
|
||||
# Page load timeout
|
||||
if "Timeout" in exc_name or "timeout" in reason:
|
||||
if ("Timeout" in exc_name or "timeout" in reason) and not _is_infra_timeout:
|
||||
categories.append(
|
||||
{
|
||||
"category": "PAGE_LOAD_TIMEOUT",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue