Task Monitor Service#

class ccat_data_transfer.task_monitor_service.TaskMonitorService(redis_client, session_factory, notification_service)[source]#

Bases: object

Service to monitor and recover stalled tasks for all operation types.

__init__(redis_client, session_factory, notification_service)[source]#
check_stalled_tasks()[source]#

Find and recover stalled tasks.

reset_circuit_breaker(operation_type, operation_id, reason=None)[source]#

Manually reset the circuit breaker for a specific operation.

Parameters:
  • operation_type (str) – Type of operation (package, transfer, etc.)

  • operation_id (int) – ID of the operation

  • reason (str, optional) – Reason for manual reset

force_retry_stalled_task(task_id, operation_type, operation_id, reason=None)[source]#

Force a retry of a stalled task by resetting its circuit breaker and state.

Parameters:
  • task_id (str) – ID of the stalled task

  • operation_type (str) – Type of operation

  • operation_id (int) – ID of the operation

  • reason (str, optional) – Reason for forced retry

Overview#

The Task Monitor Service monitors Celery task execution and status.

Key Functions#

  • monitor_tasks() - Monitor task execution

  • get_task_status() - Get task status