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
It looks at every node of kind app-server, and fires when:
- — the node has at least one synchronous outgoing edge to a worker
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.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.
airbnb-searchreferenceamazon-orderreferencecanva-uploadsreferencedatadog-huskyreferenceduolingo-backendreferencegithub-mysqlreferencehotstar-streamingreferencekhan-academy-goliathreferencelinear-syncreferencenotion-shardingreferencepaypal-paymentsreferencepinterest-feedreferencestock-exchangereferencetwitter-timelinereferenceyoutube-upload-playbackreference
# 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."