Fan-out inline in the request path

warningfanout-inline-in-request-path

Calling a worker synchronously puts the background job on the request path. The caller waits for the slowest part of the fan-out.

Severity
warning
Selects
every node of kind app-server
Components in scope
99
What it checks

It looks at every node of kind app-server, and fires when:

  • — the node has at least one synchronous outgoing edge to a worker
Message
Service '{{node.id}}' calls a worker synchronously. Hand the job to a queue or stream so the request path does not wait for fan-out.

{{node.id}} style paths are filled in from the node, the edge or the design the finding is about.

Applies to · 99 components
Tripped by · 15

Reference designs whose broken twin names this rule in its header. The gate reads the same header, and fails when a rule no design trips.

Source
# yaml-language-server: $schema=../schema/rule.schema.json
# An app-server that calls a worker synchronously puts fan-out (or any background job) on the
# request path: the caller's latency becomes the tail of the follower distribution.
# Tripped by: designs/twitter-timeline.broken.yaml
schemaVersion: "1"
type: "rule"
id: "fanout-inline-in-request-path"
severity: "warning"
select:
  node:
    kind: "app-server"
when:
  hasEdge:
    direction: "out"
    mode: "sync"
    peerKind: "worker"
message: "Service '{{node.id}}' calls a worker synchronously. Hand the job to a queue or stream so the request path does not wait for fan-out."

The same page as markdown, for an agent: /catalogue/rules/fanout-inline-in-request-path.md