prefect_aws.microvm.supervisor
Runs a flow run in a forked child process and reports the child’s crashes.
Functions
execute_flow_run
payload in the current process.
Args:
payload: The flow run to execute. If it has anentrypoint, the flow is loaded from that entrypoint, relative toworking_dirwhen one is given. Otherwise the flow is loaded from the flow run’s deployment.
run_child
payload: The flow run to execute.
supervise_flow_run
Crashed is proposed
for the flow run. SIGTERM sent to this process is forwarded to the child.
Call this from the main thread.
Args:
payload: The flow run to execute.
- The exit code for this process: 0 if the child exited 0, otherwise 1.
describe_child_exit
os.waitpid status.
Args:
wait_status: The status returned byos.waitpid.
- None if the child exited 0, otherwise a phrase such as
"was killed by signal 9"or"exited with code 1".
report_crash
Crashed for a flow run. A flow run in a final state keeps it.
Args:
flow_run_id: The ID of the flow run.crash_reason: How the flow run’s process ended, for the state message.