From edda3a068d8e4453c8206eabc7702d6febf6734b Mon Sep 17 00:00:00 2001 From: Molecule AI Documentation Specialist Date: Sat, 18 Apr 2026 03:04:32 +0000 Subject: [PATCH] docs(api-ref): note atomic hibernate guarantee from PR #882 Closes the TOCTOU race (PR #882/issue #819): documents that hibernation uses an atomic SQL claim that aborts if active_tasks > 0 at commit time, so no in-flight task is silently dropped. Co-Authored-By: Claude Sonnet 4.6 --- content/docs/api-reference.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/content/docs/api-reference.mdx b/content/docs/api-reference.mdx index 82c43f6..2a6c8de 100644 --- a/content/docs/api-reference.mdx +++ b/content/docs/api-reference.mdx @@ -104,6 +104,8 @@ Core workspace CRUD and lifecycle operations. ```yaml hibernation_idle_minutes: 30 # hibernate after 30 min idle; null (default) = disabled ``` + + **Atomic hibernation guarantee:** The platform uses a single atomic SQL claim (`UPDATE … WHERE active_tasks = 0`) before stopping the container. If a task arrives between the idle check and the container stop, the claim fails and hibernation is aborted — no in-flight tasks are silently lost. ---