{
  "slug": "kombu-redis-restore-sweep",
  "version": 1,
  "project": "kombu",
  "title": "Kombu Redis unacknowledged message restore sweep",
  "description": "A restore attempt first passes the call throttle, computes a cutoff using the scanning worker's visibility timeout, and acquires the shared restore mutex. It selects due delivery tags and restores each selected tag. Throttled attempts, an unavailable mutex or an empty selection do not requeue messages.",
  "config": {
    "design": "flowchart-top-down-diamonds-side-branches",
    "name": "redis-restore-sweep",
    "style": "clean",
    "palette": [
      "#976342"
    ],
    "accessibility": {
      "title": "Kombu Redis unacknowledged message restore sweep",
      "description": "A restore attempt first passes the call throttle, computes a cutoff using the scanning worker's visibility timeout, and acquires the shared restore mutex. It selects due delivery tags and restores each selected tag. Throttled attempts, an unavailable mutex or an empty selection do not requeue messages."
    },
    "parameters": {
      "nodes": [
        {
          "id": "start",
          "label": "restore_visible() called",
          "kind": "start"
        },
        {
          "id": "throttle",
          "label": "Throttle permits a scan?",
          "kind": "decision"
        },
        {
          "id": "cutoff",
          "label": "Cutoff: now - worker visibility_timeout",
          "kind": "process"
        },
        {
          "id": "mutex",
          "label": "Shared restore mutex available?",
          "kind": "decision"
        },
        {
          "id": "due",
          "label": "Index scan finds due delivery tags?",
          "kind": "decision"
        },
        {
          "id": "restore",
          "label": "Restore each selected delivery tag",
          "kind": "process"
        },
        {
          "id": "finish",
          "label": "Sweep finished; release mutex",
          "kind": "end"
        },
        {
          "id": "throttled",
          "label": "Skip this restore attempt",
          "kind": "end"
        },
        {
          "id": "held",
          "label": "Another worker holds the mutex; skip",
          "kind": "end"
        }
      ],
      "edges": [
        {
          "from": "start",
          "to": "throttle"
        },
        {
          "from": "throttle",
          "to": "cutoff",
          "label": "Yes"
        },
        {
          "from": "throttle",
          "to": "throttled",
          "label": "No"
        },
        {
          "from": "cutoff",
          "to": "mutex"
        },
        {
          "from": "mutex",
          "to": "due",
          "label": "Yes"
        },
        {
          "from": "mutex",
          "to": "held",
          "label": "No"
        },
        {
          "from": "due",
          "to": "restore",
          "label": "Yes"
        },
        {
          "from": "due",
          "to": "finish",
          "label": "No"
        },
        {
          "from": "restore",
          "to": "finish"
        }
      ]
    }
  },
  "files": {
    "svg": {
      "url": "/diagram-sources/kombu-redis-restore-sweep/v1/diagram.svg",
      "sha256": "edec0783e7825e71c03c1b1b2218ba7f4ba1adc92062af4a18e3fe84f036bdc6"
    },
    "png": {
      "url": "/diagram-sources/kombu-redis-restore-sweep/v1/diagram.png",
      "sha256": "b20be2865186f9d0d739f5085ebfd4cf45a7e09cb6fb7519430b6d139d7bf0b4"
    }
  }
}
