{
  "code": null,
  "collection": "architecture",
  "href": "https://banes-lab.com/ontology#architecture-graceful-shutdown",
  "id": "graceful-shutdown",
  "kind": "mechanism",
  "layer": {
    "href": "https://banes-lab.com/ontology/schema#layer-correctness-core",
    "json": "https://banes-lab.com/json/records/layer/correctness-core",
    "label": "Correctness Core",
    "markdown": "https://banes-lab.com/records/layer/correctness-core.md",
    "ref": "layer:correctness-core"
  },
  "name": "Graceful Shutdown",
  "ref": "architecture:graceful-shutdown",
  "relations": [
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology/lexicon#lexicon-lifecycle-signals",
          "json": "https://banes-lab.com/json/records/lexicon/lifecycle-signals",
          "label": "Lifecycle Signals",
          "markdown": "https://banes-lab.com/records/lexicon/lifecycle-signals.md",
          "ref": "lexicon:lifecycle-signals"
        }
      ],
      "relation": "requires"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology/lexicon#lexicon-reliability",
          "json": "https://banes-lab.com/json/records/lexicon/reliability",
          "label": "Reliability",
          "markdown": "https://banes-lab.com/records/lexicon/reliability.md",
          "ref": "lexicon:reliability"
        },
        {
          "href": "https://banes-lab.com/ontology/lexicon#lexicon-data-integrity",
          "json": "https://banes-lab.com/json/records/lexicon/data-integrity",
          "label": "Data Integrity",
          "markdown": "https://banes-lab.com/records/lexicon/data-integrity.md",
          "ref": "lexicon:data-integrity"
        }
      ],
      "relation": "reinforces"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology/lexicon#lexicon-in-flight-work-drain",
          "json": "https://banes-lab.com/json/records/lexicon/in-flight-work-drain",
          "label": "In-Flight Work Drain",
          "markdown": "https://banes-lab.com/records/lexicon/in-flight-work-drain.md",
          "ref": "lexicon:in-flight-work-drain"
        },
        {
          "href": "https://banes-lab.com/ontology/lexicon#lexicon-connection-cleanup",
          "json": "https://banes-lab.com/json/records/lexicon/connection-cleanup",
          "label": "Connection Cleanup",
          "markdown": "https://banes-lab.com/records/lexicon/connection-cleanup.md",
          "ref": "lexicon:connection-cleanup"
        }
      ],
      "relation": "enables"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology/lexicon#lexicon-hard-process-kill",
          "json": "https://banes-lab.com/json/records/lexicon/hard-process-kill",
          "label": "Hard Process Kill",
          "markdown": "https://banes-lab.com/records/lexicon/hard-process-kill.md",
          "ref": "lexicon:hard-process-kill"
        }
      ],
      "relation": "conflicts-with"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology/lexicon#lexicon-shutdown-latency",
          "json": "https://banes-lab.com/json/records/lexicon/shutdown-latency",
          "label": "Shutdown Latency",
          "markdown": "https://banes-lab.com/records/lexicon/shutdown-latency.md",
          "ref": "lexicon:shutdown-latency"
        }
      ],
      "relation": "tensions-with"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology/schema#tension-graceful-shutdown-shutdown-latency",
          "json": "https://banes-lab.com/json/records/tension/graceful-shutdown-shutdown-latency",
          "label": "Graceful Shutdown / Shutdown Latency",
          "markdown": "https://banes-lab.com/records/tension/graceful-shutdown-shutdown-latency.md",
          "ref": "tension:graceful-shutdown-shutdown-latency"
        }
      ],
      "relation": "tensions"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology/lexicon#lexicon-hard-process-kill",
          "json": "https://banes-lab.com/json/records/lexicon/hard-process-kill",
          "label": "Hard Process Kill",
          "markdown": "https://banes-lab.com/records/lexicon/hard-process-kill.md",
          "ref": "lexicon:hard-process-kill"
        }
      ],
      "relation": "violated-by"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology/schema#vocabulary-severity-contextual",
          "json": "https://banes-lab.com/json/records/vocabulary/severity-contextual",
          "label": "contextual",
          "markdown": "https://banes-lab.com/records/vocabulary/severity-contextual.md",
          "ref": "vocabulary:severity-contextual"
        }
      ],
      "relation": "severity"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology#architecture-category-self-healing-recovery-deployment-safety",
          "json": "https://banes-lab.com/json/records/architecture-category/self-healing-recovery-deployment-safety",
          "label": "Self-Healing / Recovery / Deployment Safety",
          "markdown": "https://banes-lab.com/records/architecture-category/self-healing-recovery-deployment-safety.md",
          "ref": "architecture-category:self-healing-recovery-deployment-safety"
        }
      ],
      "relation": "category"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/software-architecture/principles#computation-and-resource",
          "json": "https://banes-lab.com/json/software-architecture/principles/computation-and-resource",
          "label": "Computation and resource",
          "markdown": "https://banes-lab.com/software-architecture/principles/computation-and-resource.md",
          "ref": "chapter:/software-architecture/principles#computation-and-resource"
        },
        {
          "href": "https://banes-lab.com/ontology/lexicon#lexicon-category-quality-attributes",
          "json": "https://banes-lab.com/json/ontology/lexicon/lexicon-category-quality-attributes",
          "label": "Quality Attributes",
          "markdown": "https://banes-lab.com/ontology/lexicon/lexicon-category-quality-attributes.md",
          "ref": "chapter:/ontology/lexicon#lexicon-category-quality-attributes"
        },
        {
          "href": "https://banes-lab.com/ontology/lexicon#lexicon-category-self-healing-recovery-deployment-safety",
          "json": "https://banes-lab.com/json/ontology/lexicon/lexicon-category-self-healing-recovery-deployment-safety",
          "label": "Self-Healing / Recovery / Deployment Safety",
          "markdown": "https://banes-lab.com/ontology/lexicon/lexicon-category-self-healing-recovery-deployment-safety.md",
          "ref": "chapter:/ontology/lexicon#lexicon-category-self-healing-recovery-deployment-safety"
        },
        {
          "href": "https://banes-lab.com/ontology/schema#the-vocabulary-severity",
          "json": "https://banes-lab.com/json/ontology/schema/the-vocabulary-severity",
          "label": "Severity levels",
          "markdown": "https://banes-lab.com/ontology/schema/the-vocabulary-severity.md",
          "ref": "chapter:/ontology/schema#the-vocabulary-severity"
        },
        {
          "href": "https://banes-lab.com/ontology/schema#the-resolutions",
          "json": "https://banes-lab.com/json/ontology/schema/the-resolutions",
          "label": "The resolutions",
          "markdown": "https://banes-lab.com/ontology/schema/the-resolutions.md",
          "ref": "chapter:/ontology/schema#the-resolutions"
        }
      ],
      "relation": "linked-from"
    }
  ],
  "summary": "A mechanism that, on a stop signal, stops accepting work, drains in-flight work and closes connections before the process exits.",
  "siblings": {
    "next": {
      "href": "https://banes-lab.com/ontology#architecture-raid-redundancy",
      "json": "https://banes-lab.com/json/records/architecture/raid-redundancy",
      "label": "RAID Redundancy",
      "markdown": "https://banes-lab.com/records/architecture/raid-redundancy.md",
      "ref": "architecture:raid-redundancy"
    },
    "previous": {
      "href": "https://banes-lab.com/ontology#architecture-chaos-engineering",
      "json": "https://banes-lab.com/json/records/architecture/chaos-engineering",
      "label": "Chaos Engineering",
      "markdown": "https://banes-lab.com/records/architecture/chaos-engineering.md",
      "ref": "architecture:chaos-engineering"
    }
  },
  "up": {
    "href": null,
    "json": "https://banes-lab.com/json/api/records/architecture",
    "label": "Architecture principles",
    "markdown": "https://banes-lab.com/api/records/architecture.md",
    "ref": "api:records/architecture"
  },
  "aliases": [],
  "exemplar": {
    "after": "process.on(\"SIGTERM\", async () => {\n  server.stopAccepting();\n  await fooQueue.drain();\n  await server.close();\n  process.exit(0);\n});",
    "before": "process.on(\"SIGTERM\", () => process.exit(0));",
    "lang": "ts",
    "medium": "code"
  },
  "formedBy": null,
  "scope": [
    "service",
    "runtime",
    "resilience"
  ],
  "severity": "contextual"
}
