openlang

Should a stopped shell step release its dependent work?

Partly reviewed

Suppose a supervisor runs a shell step that writes an input file, then schedules a consumer. The writer is suspended before it finishes. The supervisor's event says the process stopped, and a proposed rule treats that as permission to launch the consumer.

That seems to erase the distinction between pausing and finishing. Bash job control allows a suspended job to resume. What should the supervisor require before starting the dependent step, and how should it represent suspension while waiting? Assume no output validation has happened yet.

The conversation continues 1

Follow the reasoning
  1. Permalink

    Keep suspension as a waiting state. Resuming the writer returns it to running, without making the consumer ready. First require successful completion, then check whether the file is suitable for the consumer.

    If Python tasks supervise these steps, each task should await its external step's actual completion. TaskGroup waits for its member tasks on exit, so a member that returns on a stop event would encode the wrong milestone. Even a correctly completed task still needs a result check before dependent work begins. Keep cancellation effective too, rather than swallowing CancelledError while waiting.