Surface a failing connector poll as node health and a flow issue
The poll loop remembered what it read rather than what it published, so a value the node could not publish counted as said: the next poll skipped it, succeeded, and health went back to ok with the port still dark. Remember it only after inject returns, and report ok last. A node reporting itself down is now derived into its flow's issues on read and counted on the health summary, so the canvas marks it and Home says so. Being down does not stop the flow, and the issue clears by itself when the node reports well again. The repeating poll warning is logged once per outage rather than once per tick. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1moruzue2kTJd3uVisgNk
This commit is contained in:
@@ -163,10 +163,13 @@ to:
|
||||
| `self_loop_needs_initial` | a node reads a message it also writes, with no starting value |
|
||||
| `node_error` | the node's code did not load: a syntax error, a missing import |
|
||||
| `unauthenticated_hook` | advisory — a webhook with no shared secret is open to anyone |
|
||||
| `node_unhealthy` | the node loaded but is not working: a connector that cannot reach its device, or whose last publication failed |
|
||||
|
||||
A flow with any of these except the advisory one does not run. The health
|
||||
summary on Home counts them, so "why is nothing happening?" has an answer that
|
||||
does not involve reading logs.
|
||||
A flow with any of these except the advisory one and `node_unhealthy` does not
|
||||
run — a node reporting itself down is a live condition, not a build error, so
|
||||
the rest of the flow keeps going and the issue clears by itself once the node
|
||||
reports well again. The health summary on Home counts them, so "why is nothing
|
||||
happening?" has an answer that does not involve reading logs.
|
||||
|
||||
## What happens at runtime
|
||||
|
||||
|
||||
@@ -146,9 +146,12 @@ The canvas validates as you edit and marks the node each issue belongs to:
|
||||
- a node reading a message it also writes, with nothing to start it from
|
||||
- code that did not load
|
||||
- a webhook with no shared secret (advisory — it does not stop the flow)
|
||||
- a node that loaded but reports itself down, such as a connector that cannot
|
||||
reach its device
|
||||
|
||||
A flow with any of these except the last does not run, and the health summary
|
||||
on Home counts it.
|
||||
A flow with any of these except the last two does not run, and the health
|
||||
summary on Home counts it. The last one clears on its own once the node reports
|
||||
itself well again.
|
||||
|
||||
## See also
|
||||
|
||||
|
||||
@@ -131,7 +131,9 @@ async def poll(self) -> dict[str, Any] | None:
|
||||
- Return `None` when there is nothing new.
|
||||
- **Only changed values are published.** A device polled every few seconds
|
||||
usually says the same thing, and every publication wakes everything
|
||||
downstream, so the loop compares against what it last published.
|
||||
downstream, so the loop compares against what it last published — what it
|
||||
actually published, so a publication that failed is retried next tick rather
|
||||
than counting as said.
|
||||
- Raising is not fatal: it is reported as a health problem and retried on the
|
||||
next tick.
|
||||
- The loop calls `inject`, which runs the graph, on a worker thread. `poll()`
|
||||
@@ -213,9 +215,10 @@ self.report_health("degraded", "3 of 5 registers timed out")
|
||||
self.report_health("down", str(exc))
|
||||
```
|
||||
|
||||
Three values, `ok`, `degraded` and `down`, plus an optional detail string. The
|
||||
engine forwards changes to the editor, which shows them on the node. Reporting
|
||||
the same status twice is free — only changes are published. The polling loop
|
||||
Three values, `ok`, `degraded` and `down`, plus an optional detail string.
|
||||
Reporting the same status twice is free — only changes are published. A node
|
||||
reporting `down` is named among its flow's issues and counted on the health
|
||||
summary on Home; `degraded` means still working, and is not. The polling loop
|
||||
already reports around `poll()`; a connector managing its own connection should
|
||||
report when it connects and when it loses the connection.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user