worker_node.worker_node_task_instance
The Task Instance Object once it has been submitted to run on a worker node.
Attributes
Classes
The Task Instance object once it has been submitted to run on a worker node. |
Module Contents
- worker_node.worker_node_task_instance.logger
- class worker_node.worker_node_task_instance.WorkerNodeTaskInstance(cluster_interface: jobmon.core.cluster_protocol.ClusterWorkerNode, task_instance_id: int, task_instance_heartbeat_interval: int | None = None, heartbeat_report_by_buffer: float | None = None, command_interrupt_timeout: int | None = None, requester: jobmon.core.requester.Requester | None = None)
The Task Instance object once it has been submitted to run on a worker node.
A mechanism whereby a running task_instance can communicate back to the JSM.
Logs its status, errors, usage details, etc.
- Parameters:
cluster_interface – interface that gathers executor info in the execution_wrapper.
task_instance_id – the id of the TaskInstance that is reporting back.
task_instance_heartbeat_interval – how ofter to log a report by with the db
heartbeat_report_by_buffer – multiplier for report by date in case we miss a few.
command_interrupt_timeout – the amount of time to wait for the child process to terminate.
requester – communicate with the flask services.
- requester = None
- cluster_interface
- log_error(error_state: str, description: str) None
Tell the JobStateManager that this task_instance has errored.
- log_running() None
Tell the JobStateManager that this task_instance is running.
Update the report_by_date to be further in the future in case it gets reconciled immediately.
- async log_report_by(session: aiohttp.ClientSession) None
Log the heartbeat to show that the task instance is still alive.
Uses the async requester with an aiohttp ClientSession so heartbeats can run concurrently with other asyncio work (subprocess pipe drain, lazy log-directory creation in
_communicate). Running on the event loop instead of the default thread-pool avoids the executor pressure thatasyncio.to_threadwould add when multiple slow I/O paths are in flight at the same time.