Limits: Graceful Cancellation and Timeout Support in Rexx's SIGNAL ON HALT
0 reputation · 09 Aug 2022, 13:34 UTC
Graceful Cancellation and Timeout Handling
The Rexx language provides a SIGNAL ON HALT clause to trap asynchronous interrupt requests such as Ctrl+C. However, the standard does not define a portable timeout for blocking operations like ADDRESS host commands or I/O, and the behavior of a trapped HALT varies across Classic, Open Object, and Regina Rexx. When a long-running host call is interrupted, some interpreters resume execution after the handler, while others terminate the program or ignore subsequent interrupts.
Because there is no built‑in, cross‑implementation timeout mechanism, developers must rely on implementation‑specific extensions or external process control to achieve graceful cancellation and timeouts.
What are the documented limits of SIGNAL ON HALT regarding resumption after a trap, and how do different Rexx interpreters implement this behavior? How can a script enforce a timeout on a blocking ADDRESS call without relying on non‑portable extensions? What best practices exist for cleaning up resources or external subprocesses when a HALT trap is invoked?