From d01ecb9f2c380fc2d4222dddfbeff535705ccc3d Mon Sep 17 00:00:00 2001 From: zumbrunn Date: Mon, 26 Oct 2026 22:50:01 +0100 Subject: [PATCH 1/2] docs(deployment): the hang watchdog Refs duneorg/dune#42 Co-Authored-By: Claude Sonnet 5.5 --- 05.deployment/10.hang-watchdog/default.md | 91 +++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 05.deployment/10.hang-watchdog/default.md diff --git a/05.deployment/10.hang-watchdog/default.md b/05.deployment/10.hang-watchdog/default.md new file mode 100644 index 0000000..208bc52 --- /dev/null +++ b/05.deployment/10.hang-watchdog/default.md @@ -0,0 +1,91 @@ +--- +title: "Hang Watchdog" +published: true +visible: true +taxonomy: + audience: [webmaster, developer] + difficulty: [intermediate] + topic: [deployment, operations] +metadata: + description: "How Dune detects a blocked event loop, what it does about it, and how to keep it from killing legitimate work" +--- + +# Hang Watchdog + +Dune serves every request on one thread. If a synchronous loop gets stuck on that thread (catastrophic regex backtracking, a conversion that never terminates), the server stops answering **every** URL at once, logs nothing, and stays that way until someone restarts it. A blocked thread can't rescue itself, so `dune dev` and `dune serve` run a small watchdog on a separate thread. + +## What it does + +The main thread sends the watchdog a heartbeat every second. If the heartbeats stop for longer than the limit, the watchdog: + +1. writes a report to `/.dune/hangs/hang-