---
id: "shared-worker-pool-across-queues"
type: "rule"
severity: "warning"
url: "https://localhost:3000/catalogue/rules/shared-worker-pool-across-queues"
---

# Shared worker pool across queues

One worker consumes more than one queue while the design requires per-queue isolation.

| | |
|---|---|
| Severity | warning |
| Selects | every node of kind worker |
| Components in scope | 83 |

## Why

One worker pool consuming several queues lets a slow or poisoned queue starve the others. That is precisely what the design's per-queue isolation requirement forbids.

## What it checks

It looks at every node of kind worker, and fires when:

- all of these hold:
  - the node has more than 1 incoming edge from a queue
  - the design requirement `isolation.perQueue` is true

Message template:

```
Worker '{{node.id}}' consumes more than one queue while the design requires per-queue isolation. Give each queue its own worker pool.
```

## Applies to

- [Worker](https://localhost:3000/catalogue/kinds/worker.md) `worker`

83 catalogue components fall under it.

## Tripped by

Reference designs whose broken twin names this rule in its header:

- [canva-uploads](https://localhost:3000/d/zeema/canva-uploads)
- [distributed-email](https://localhost:3000/d/zeema/distributed-email)
- [duolingo-backend](https://localhost:3000/d/zeema/duolingo-backend)
- [gitlab-architecture](https://localhost:3000/d/zeema/gitlab-architecture)
- [meta-threads](https://localhost:3000/d/zeema/meta-threads)
- [pinterest-feed](https://localhost:3000/d/zeema/pinterest-feed)
- [reddit-feed](https://localhost:3000/d/zeema/reddit-feed)
- [slack-messaging](https://localhost:3000/d/zeema/slack-messaging)
- [wikipedia](https://localhost:3000/d/zeema/wikipedia)

## Source (`rule` YAML, verbatim)

```yaml
# yaml-language-server: $schema=../schema/rule.schema.json
# One worker pool consuming several queues means a slow or poisoned queue starves the
# others, which is exactly what the per-queue isolation requirement forbids.
# Tripped by: designs/slack-messaging.broken.yaml
schemaVersion: "1"
type: "rule"
id: "shared-worker-pool-across-queues"
severity: "warning"
select:
  node:
    kind: "worker"
when:
  all:
    - hasEdge:
        direction: "in"
        peerKind: "queue"
        count:
          gt: 1
    - requirement: "isolation.perQueue"
      equals: true
message: "Worker '{{node.id}}' consumes more than one queue while the design requires per-queue isolation. Give each queue its own worker pool."
```

Human page: https://localhost:3000/catalogue/rules/shared-worker-pool-across-queues
