BUG: recorders.js dockerApi has no socket timeout — hung Docker socket blocks recorder start/stop indefinitely #91

Closed
opened 2026-05-25 19:29:39 -04:00 by zgaetano · 1 comment
Owner

Already fixed. dockerApi() in services/mam-api/src/routes/recorders.js sets req.setTimeout(10000, ...) and destroys the request on timeout. Verified during #121 work.

Already fixed. `dockerApi()` in `services/mam-api/src/routes/recorders.js` sets `req.setTimeout(10000, ...)` and destroys the request on timeout. Verified during #121 work.
Author
Owner

Fix Plan — #91 dockerApi has no socket timeout

Root cause: recorders.js:22-38dockerApi() uses http.request() with no timeout. Hung Docker daemon → all recorder start/stop hang indefinitely.

Fix — add to dockerApi():

function dockerApi(method, path, body) {
  return new Promise((resolve, reject) => {
    const req = http.request({
      socketPath: "/var/run/docker.sock",
      path,
      method,
      headers: { "Content-Type": "application/json" }
    }, (res) => { /* ... existing handler ... */ });

    req.setTimeout(10000, () => {
      req.destroy(new Error("Docker API timeout"));
    });

    req.on("error", reject);
    if (body) req.write(JSON.stringify(body));
    req.end();
  });
}

Files: src/routes/recorders.js:22-38
Effort: ~30min
**Priority: P1 — availability

## Fix Plan — #91 dockerApi has no socket timeout **Root cause:** `recorders.js:22-38` — `dockerApi()` uses `http.request()` with no timeout. Hung Docker daemon → all recorder start/stop hang indefinitely. **Fix — add to `dockerApi()`:** ```js function dockerApi(method, path, body) { return new Promise((resolve, reject) => { const req = http.request({ socketPath: "/var/run/docker.sock", path, method, headers: { "Content-Type": "application/json" } }, (res) => { /* ... existing handler ... */ }); req.setTimeout(10000, () => { req.destroy(new Error("Docker API timeout")); }); req.on("error", reject); if (body) req.write(JSON.stringify(body)); req.end(); }); } ``` **Files:** `src/routes/recorders.js:22-38` **Effort:** ~30min **Priority: P1 — availability
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: WildDragonLLC/dragonflight#91
No description provided.