#101 等待搬回引擎——WASI 沙箱裡沒有「不花 CPU 地等」這種東西 #103
Reference in New Issue
Block a user
Delete Branch "fix/wait-not-in-wasm-101"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
leo:「燒 CPU 影響錢,需要做。」
病:wait 零件在 youlin stage 上,不管
ms填多少都撐到 ~35 秒被 CPU 上限砍掉(503/1102):四個值同一種死法、與 ms 無關 ⇒ 病不是「等待很貴」,是等待從來沒成功過。
修法:wait 移進
BUILTIN_COMPONENTS,由引擎 await 一個 timer——只花 wall-clock、不記 CPU。既有 workflow 的 wait 節點定義不必改。🔴 誠實標明:原本註解把「Workers 時鐘在同步執行期間凍結、所以自旋永不結束」寫成結論。寫測試去證反而被打臉——workerd 裡自旋 2553 圈後
Date.now()就前進了。那條假斷言已刪除,不是改鬆;完整機制降級成推測。修法不依賴它:純 WASI 沙箱本來就沒有睡覺這個手段。實測:
還沒驗的:真的部署上去跑一次那條 input >> wait 工作流。⇒ 現在是 ◐ 半通。
合併部署後,出貨線最後兩站(17/19 卡在 wait_node)才可能通,
arcrun-rag#47也才解得掉。