From 0d72835842d59b2f33f3dc2414e3f6d66bf38c61 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Thu, 17 Sep 2026 19:08:12 +0700 Subject: [PATCH] The escape hatch says which hatch it is when asked for a re-run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --two-process has no parked thread to wake. Its program is a child, and a child that finishes is gone, so running main again is not something that shape can do — and saying "the program is already running" would send somebody back to try again after it had exited. It names itself instead. --x86 arrives here too and is the reason this is worth a round trip rather than none: --x86 refuses the merged daemon, for the -rdynamic reason the case below already records, so every x86 dev loop is a two-process one and this is the answer it gets. --- test/test_dev.ml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/test_dev.ml b/test/test_dev.ml index 996001e..162e992 100644 --- a/test/test_dev.ml +++ b/test/test_dev.ml @@ -2839,6 +2839,20 @@ let () = ignore (ask "(:op \"describe\")"); contains_sub (Buffer.contents seen) "42")) then fail "--two-process: the reload was never installed"; + (* And the one verb this shape cannot have. Running [main] again means + waking a thread that parked inside this process, and here the program + is a child: when it finishes it is gone, and there is nothing to wake. + Refused by naming what this daemon is rather than with the message a + merged one gives, because "the program is already running" would send + somebody back to try again after it had exited — and [--x86] arrives + here too, since it refuses the merged daemon for the -rdynamic reason + given below. *) + let r = ask "(:op \"rerun\")" in + let why = Option.value ~default:(status r) (Wire.string_field r "message") in + if status r <> "error" then + fail "--two-process answered a rerun it cannot perform" + else if not (contains_sub why "two-process") then + fail "--two-process refuses a rerun as: %s" why; ignore (ask "(:op \"close\")"); Unix.close tc end;